|
@@ -49,9 +49,9 @@ func (a *AesCBCWithPadding) Encrypt(plaintext []byte) ([]byte, error) {
|
|
|
ciphertext := make([]byte, aes.BlockSize+len(plaintext))
|
|
|
copy(ciphertext[:aes.BlockSize], a.iv)
|
|
|
mode := cipher.NewCBCEncrypter(block, a.iv)
|
|
|
- mode.CryptBlocks(ciphertext, plaintext)
|
|
|
+ mode.CryptBlocks(ciphertext[aes.BlockSize:], plaintext)
|
|
|
|
|
|
- return ciphertext, nil
|
|
|
+ return ciphertext[aes.BlockSize:], nil
|
|
|
}
|
|
|
|
|
|
// AES解密函数
|