add firefox for windows decrypt Closes #11

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2020-07-09 19:34:26 +08:00
parent 43f6452f98
commit f42af9b953
4 changed files with 128 additions and 53 deletions
+16
View File
@@ -1,6 +1,7 @@
package utils
import (
"crypto/aes"
"crypto/cipher"
"crypto/des"
"encoding/asn1"
@@ -224,3 +225,18 @@ func DecodeLogin(decodeItem []byte) (pbe LoginPBE, err error) {
}
return pbe, nil
}
func aes128CBCDecrypt(key, iv, encryptPass []byte) ([]byte, error) {
if len(chromeKey) == 0 {
return []byte{}, nil
}
block, err := aes.NewCipher(key)
if err != nil {
return []byte{}, err
}
dst := make([]byte, len(encryptPass))
mode := cipher.NewCBCDecrypter(block, iv)
mode.CryptBlocks(dst, encryptPass)
dst = PKCS5UnPadding(dst)
return dst, nil
}