docs: add key function documents

This commit is contained in:
moond4rk
2020-11-10 14:11:16 +08:00
committed by ᴍᴏᴏɴD4ʀᴋ
parent b5ec1e89e6
commit 24f2ceb6b4
8 changed files with 69 additions and 72 deletions
+2
View File
@@ -6,6 +6,7 @@ import (
"crypto/des"
"encoding/asn1"
"errors"
"hack-browser-data/log"
)
@@ -33,6 +34,7 @@ func PKCS5UnPadding(src []byte) []byte {
return src[:(length - unpad)]
}
// Des3Decrypt use for decrypt firefox PBE
func Des3Decrypt(key, iv []byte, src []byte) ([]byte, error) {
block, err := des.NewTripleDESCipher(key)
if err != nil {
+1
View File
@@ -4,6 +4,7 @@ import (
"crypto/hmac"
"crypto/sha1"
"encoding/asn1"
"hack-browser-data/log"
)
+1 -2
View File
@@ -6,6 +6,7 @@ import (
"crypto/sha256"
"encoding/asn1"
"encoding/hex"
"hack-browser-data/log"
"golang.org/x/crypto/pbkdf2"
@@ -40,7 +41,6 @@ SEQUENCE (2 elem)
INTEGER 1
OCTET STRING (16 byte)
*/
type MetaPBE struct {
SequenceA
Encrypted []byte
@@ -101,7 +101,6 @@ func DecodeMeta(decodeItem []byte) (pbe MetaPBE, err error) {
}
func DecodeNss(nssA11Bytes []byte) (pbe NssPBE, err error) {
log.Debug(hex.EncodeToString(nssA11Bytes))
_, err = asn1.Unmarshal(nssA11Bytes, &pbe)
if err != nil {
log.Error(err)
+2 -1
View File
@@ -7,10 +7,11 @@ import (
"crypto/sha256"
"encoding/asn1"
"encoding/hex"
"hack-browser-data/log"
"syscall"
"unsafe"
"hack-browser-data/log"
"golang.org/x/crypto/pbkdf2"
)