jd decode
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func AESCBCEncpryt(data, aesKey, iv []byte) (encryptedData []byte, err error) {
|
||||
@@ -23,9 +24,11 @@ func AESCBCDecpryt(encryptedData, aesKey, iv []byte) (decryptedData []byte, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
fmt.Println(c.BlockSize(), len(encryptedData))
|
||||
cfbdec := cipher.NewCBCDecrypter(c, iv[:c.BlockSize()])
|
||||
decryptedData = make([]byte, len(encryptedData))
|
||||
cfbdec.CryptBlocks(decryptedData, encryptedData)
|
||||
|
||||
decryptedData = PKCSUnPadding(decryptedData)
|
||||
return decryptedData, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user