feat: decrypt Chromium v10/v11 across host OS

Chromium's v10 means AES-GCM on Windows but AES-CBC on macOS/Linux.
Dispatch the cipher by master-key length (32B GCM, 16B CBC) so one
binary can decrypt a key dumped from a different OS.
This commit is contained in:
moonD4rk
2026-06-01 22:44:35 +08:00
parent c444314832
commit d720762595
8 changed files with 124 additions and 117 deletions
-16
View File
@@ -2,22 +2,6 @@
package crypto
import (
"bytes"
"crypto/aes"
)
var chromiumCBCIV = bytes.Repeat([]byte{0x20}, aes.BlockSize)
const minCBCDataSize = versionPrefixLen + aes.BlockSize // "v10" + one AES block = 19 bytes minimum
func DecryptChromium(key, ciphertext []byte) ([]byte, error) {
if len(ciphertext) < minCBCDataSize {
return nil, errShortCiphertext
}
return AESCBCDecrypt(key, chromiumCBCIV, ciphertext[versionPrefixLen:])
}
func DecryptDPAPI(_ []byte) ([]byte, error) {
return nil, errDPAPINotSupported
}