Skip to content

Commit cee42e3

Browse files
committed
[代码优化](v2.5): EncryptUtils 优化在linux中,存在解密乱码的情况
close elunez#419
1 parent 73eb350 commit cee42e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eladmin-common/src/main/java/me/zhengjie/utils/EncryptUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static String desEncrypt(String source) throws Exception {
6161
* 对称解密
6262
*/
6363
public static String desDecrypt(String source) throws Exception {
64-
byte[] src = hex2byte(source.getBytes());
64+
byte[] src = hex2byte(source.getBytes(StandardCharsets.UTF_8));
6565
DESKeySpec desKeySpec = getDesKeySpec(source);
6666
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
6767
SecretKey secretKey = keyFactory.generateSecret(desKeySpec);

0 commit comments

Comments
 (0)