refactor: naming cleanup and crypto package improvements (#551)

* refactor: naming cleanup across all packages
This commit is contained in:
Roger
2026-04-05 16:51:56 +08:00
committed by GitHub
parent 4af2ded428
commit 410bffe643
49 changed files with 716 additions and 510 deletions
+4 -6
View File
@@ -12,14 +12,12 @@ import (
"github.com/moond4rk/hackbrowserdata/crypto"
)
// testCBCIV is the fixed IV Chrome uses on macOS/Linux (16 space bytes).
var testCBCIV = bytes.Repeat([]byte{0x20}, 16)
func TestDecryptValue_V10(t *testing.T) {
plaintext := []byte("test_secret_value")
encrypted, err := crypto.AES128CBCEncrypt(testAESKey, testCBCIV, plaintext)
testCBCIV := bytes.Repeat([]byte{0x20}, 16)
cbcEncrypted, err := crypto.AESCBCEncrypt(testAESKey, testCBCIV, plaintext)
require.NoError(t, err)
v10Ciphertext := append([]byte("v10"), encrypted...)
v10Ciphertext := append([]byte("v10"), cbcEncrypted...)
tests := []struct {
name string
@@ -35,7 +33,7 @@ func TestDecryptValue_V10(t *testing.T) {
{
name: "wrong key returns padding error",
key: []byte("wrong_key_1234!!"),
wantErrMsg: "pkcs5UnPadding",
wantErrMsg: "invalid PKCS5 padding",
},
}