mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-07-06 21:37:47 +02:00
refactor: naming cleanup and crypto package improvements (#551)
* refactor: naming cleanup across all packages
This commit is contained in:
@@ -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",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user