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