Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
d975baea
Commit
d975baea
authored
Mar 11, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixed
parent
449947fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
PublicController.java
...ergy/chnmuseum/party/web/controller/PublicController.java
+2
-1
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/PublicController.java
View file @
d975baea
...
@@ -16,6 +16,7 @@ import javax.crypto.Cipher;
...
@@ -16,6 +16,7 @@ import javax.crypto.Cipher;
import
javax.crypto.SecretKey
;
import
javax.crypto.SecretKey
;
import
javax.crypto.SecretKeyFactory
;
import
javax.crypto.SecretKeyFactory
;
import
javax.crypto.spec.DESKeySpec
;
import
javax.crypto.spec.DESKeySpec
;
import
java.nio.charset.StandardCharsets
;
import
java.security.SecureRandom
;
import
java.security.SecureRandom
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -47,7 +48,7 @@ public class PublicController extends BaseController {
...
@@ -47,7 +48,7 @@ public class PublicController extends BaseController {
// DES算法要求有一个可信任的随机数源
// DES算法要求有一个可信任的随机数源
SecureRandom
random
=
new
SecureRandom
();
SecureRandom
random
=
new
SecureRandom
();
// 创建一个DESKeySpec对象
// 创建一个DESKeySpec对象
DESKeySpec
desKey
=
new
DESKeySpec
(
key
.
getBytes
(
"UTF-8"
));
DESKeySpec
desKey
=
new
DESKeySpec
(
key
.
getBytes
(
StandardCharsets
.
UTF_8
));
// 创建一个密匙工厂
// 创建一个密匙工厂
SecretKeyFactory
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
SecretKeyFactory
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
// 将DESKeySpec对象转换成SecretKey对象
// 将DESKeySpec对象转换成SecretKey对象
...
...
Write
Preview
Markdown
is supported
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