mirror of https://github.com/elunez/eladmin
[代码优化](v2.5): EncryptUtils 优化在linux中,存在解密乱码的情况
close https://github.com/elunez/eladmin/issues/419pull/432/head
parent
73eb350172
commit
cee42e3a67
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue