[代码优化](v2.5): EncryptUtils 优化在linux中,存在解密乱码的情况

close https://github.com/elunez/eladmin/issues/419
pull/432/head
ZhengJie 2020-06-22 21:17:17 +08:00
parent 73eb350172
commit cee42e3a67
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ public class EncryptUtils {
*
*/
public static String desDecrypt(String source) throws Exception {
byte[] src = hex2byte(source.getBytes());
byte[] src = hex2byte(source.getBytes(StandardCharsets.UTF_8));
DESKeySpec desKeySpec = getDesKeySpec(source);
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
SecretKey secretKey = keyFactory.generateSecret(desKeySpec);