Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
cee42e3a
Commit
cee42e3a
authored
Jun 22, 2020
by
ZhengJie
Browse files
[代码优化](v2.5): EncryptUtils 优化在linux中,存在解密乱码的情况
close
https://github.com/elunez/eladmin/issues/419
parent
73eb3501
Changes
1
Hide whitespace changes
Inline
Side-by-side
eladmin-common/src/main/java/me/zhengjie/utils/EncryptUtils.java
View file @
cee42e3a
...
@@ -61,7 +61,7 @@ public class EncryptUtils {
...
@@ -61,7 +61,7 @@ public class EncryptUtils {
* 对称解密
* 对称解密
*/
*/
public
static
String
desDecrypt
(
String
source
)
throws
Exception
{
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
);
DESKeySpec
desKeySpec
=
getDesKeySpec
(
source
);
SecretKeyFactory
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
SecretKeyFactory
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
SecretKey
secretKey
=
keyFactory
.
generateSecret
(
desKeySpec
);
SecretKey
secretKey
=
keyFactory
.
generateSecret
(
desKeySpec
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment