mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
refactor: naming cleanup and crypto package improvements (#551)
* refactor: naming cleanup across all packages
This commit is contained in:
+15
-7
@@ -2,14 +2,22 @@
|
||||
|
||||
package crypto
|
||||
|
||||
func DecryptWithChromium(key, encryptPass []byte) ([]byte, error) {
|
||||
if len(encryptPass) < 3 {
|
||||
return nil, ErrCiphertextLengthIsInvalid
|
||||
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
|
||||
}
|
||||
iv := []byte{32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32}
|
||||
return AES128CBCDecrypt(key, iv, encryptPass[3:])
|
||||
return AESCBCDecrypt(key, chromiumCBCIV, ciphertext[versionPrefixLen:])
|
||||
}
|
||||
|
||||
func DecryptWithDPAPI(_ []byte) ([]byte, error) {
|
||||
return nil, nil
|
||||
func DecryptDPAPI(_ []byte) ([]byte, error) {
|
||||
return nil, errDPAPINotSupported
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user