Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
68f052ef00 |
@@ -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
|
||||
|
Reference in New Issue
Block a user