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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user