diff --git a/Falcon.SugarApi/Encryption/AESConfig.cs b/Falcon.SugarApi/Encryption/AESConfig.cs index 30ecb6e..1e9627b 100644 --- a/Falcon.SugarApi/Encryption/AESConfig.cs +++ b/Falcon.SugarApi/Encryption/AESConfig.cs @@ -11,5 +11,10 @@ /// 秘钥长度。最大32 /// public int KeyLength { get => keyLength; set => keyLength = value > 32 ? 32 : value; } + + /// + /// 秘钥字符表 + /// + public string KeyChars { get; set; } = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789,.!/*\"; } } diff --git a/Falcon.SugarApi/Encryption/AESProvider.cs b/Falcon.SugarApi/Encryption/AESProvider.cs index 47dc7e9..082eb30 100644 --- a/Falcon.SugarApi/Encryption/AESProvider.cs +++ b/Falcon.SugarApi/Encryption/AESProvider.cs @@ -73,7 +73,7 @@ namespace Falcon.SugarApi.Encryption /// public string GenerateKey() { - var chars = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789,.!/*\"; + var chars = this.Config.KeyChars; var r = new Random(); var len = this.Config.KeyLength; var sb = new StringBuilder(len);