mirror of https://gitee.com/stylefeng/roses
【8.3.0】【security】修复编码解析问题
parent
521e182672
commit
dcd2865449
|
@ -87,7 +87,7 @@ public class GuomiUtil {
|
|||
*/
|
||||
public static String sm4Encrypt(String text) {
|
||||
String sm4Key = GuomiConfigExpander.getSM4Key();
|
||||
SM4 sm4 = SmUtil.sm4(sm4Key.getBytes());
|
||||
SM4 sm4 = SmUtil.sm4(Base64.decode(sm4Key));
|
||||
return sm4.encryptBase64(text, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class GuomiUtil {
|
|||
*/
|
||||
public static String sm4Decrypt(String encryptedStr) {
|
||||
String sm4Key = GuomiConfigExpander.getSM4Key();
|
||||
SM4 sm4 = SmUtil.sm4(sm4Key.getBytes());
|
||||
SM4 sm4 = SmUtil.sm4(Base64.decode(sm4Key));
|
||||
return sm4.decryptStr(encryptedStr, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue