1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 21:02:27 +08:00

fix: fix AesCfbDecrypt

This commit is contained in:
dudaodong
2022-12-08 15:07:40 +08:00
parent 62c5e251a5
commit 3189628d54

View File

@@ -130,10 +130,10 @@ func AesCfbDecrypt(encrypted, key []byte) []byte {
panic("encrypted data is too short")
}
encrypted = encrypted[aes.BlockSize:]
block, _ := aes.NewCipher(key)
iv := encrypted[:aes.BlockSize]
encrypted = encrypted[aes.BlockSize:]
stream := cipher.NewCFBDecrypter(block, iv)
stream.XORKeyStream(encrypted, encrypted)