mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
fix: support Linux v11 cipher prefix for Chromium decryption (#571)
This commit is contained in:
@@ -16,7 +16,8 @@ func decryptValue(masterKey, ciphertext []byte) ([]byte, error) {
|
||||
|
||||
version := crypto.DetectVersion(ciphertext)
|
||||
switch version {
|
||||
case crypto.CipherV10:
|
||||
case crypto.CipherV10, crypto.CipherV11:
|
||||
// v11 is Linux-only and shares v10's AES-CBC path; only the key source differs.
|
||||
return crypto.DecryptChromium(masterKey, ciphertext)
|
||||
case crypto.CipherV20:
|
||||
// TODO: implement App-Bound Encryption (Chrome 127+)
|
||||
|
||||
@@ -52,6 +52,18 @@ func TestDecryptValue_V10(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDecryptValue_V11(t *testing.T) {
|
||||
plaintext := []byte("test_secret_value")
|
||||
testCBCIV := bytes.Repeat([]byte{0x20}, 16)
|
||||
cbcEncrypted, err := crypto.AESCBCEncrypt(testAESKey, testCBCIV, plaintext)
|
||||
require.NoError(t, err)
|
||||
v11Ciphertext := append([]byte("v11"), cbcEncrypted...)
|
||||
|
||||
got, err := decryptValue(testAESKey, v11Ciphertext)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, plaintext, got)
|
||||
}
|
||||
|
||||
func TestDecryptValue_V20(t *testing.T) {
|
||||
// v20 App-Bound Encryption is not yet implemented.
|
||||
// TODO: add successful decryption cases when implemented.
|
||||
|
||||
Reference in New Issue
Block a user