From 68f052ef00316eccdcebbc217f941e06f3153481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 18 Jul 2023 16:18:18 +0800 Subject: [PATCH] =?UTF-8?q?enhance(spiral):=E8=B0=83=E6=95=B4=E8=9E=BA?= =?UTF-8?q?=E6=97=8B=E5=8A=A0=E5=AF=86=E7=AE=97=E6=B3=95=E7=9A=84=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=BC=BA=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- encryption/spiral/spiral.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/encryption/spiral/spiral.go b/encryption/spiral/spiral.go index 3e090e1..820d29c 100644 --- a/encryption/spiral/spiral.go +++ b/encryption/spiral/spiral.go @@ -29,7 +29,7 @@ func generateKey(key string) []byte { // 对给定的数据进行加密。 func Encrypt(data string, strength ...Strength) (string, error) { var ivGen aes.IVGenerator - if append(strength, Compatible)[0] == Compatible { + if append(strength, Enhanced)[0] == Compatible { ivGen = aes.PrefixIVGenerator } else { ivGen = aes.XorIVGenerator @@ -50,7 +50,7 @@ func Encrypt(data string, strength ...Strength) (string, error) { // 对给定的数据进行解密。 func Decrypt(data string, strength ...Strength) (string, error) { var ivGen aes.IVGenerator - if append(strength, Compatible)[0] == Compatible { + if append(strength, Enhanced)[0] == Compatible { ivGen = aes.PrefixIVGenerator } else { ivGen = aes.XorIVGenerator