Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
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
huluobin
gogirl-miniapp-backend
Commits
fd3b77da
Commit
fd3b77da
authored
Apr 07, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
211d02cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
AESUtil.java
src/main/java/com/gogirl/infrastructure/util/AESUtil.java
+2
-3
WXCore.java
src/main/java/com/gogirl/infrastructure/util/WXCore.java
+1
-1
No files found.
src/main/java/com/gogirl/infrastructure/util/AESUtil.java
View file @
fd3b77da
...
@@ -32,7 +32,7 @@ public class AESUtil {
...
@@ -32,7 +32,7 @@ public class AESUtil {
*
*
* @param iv iv
* @param iv iv
* @return AlgorithmParameters
* @return AlgorithmParameters
* @throws NoSuchAlgorithmException noSuchAlgorithmException
* @throws NoSuchAlgorithmException
noSuchAlgorithmException
* @throws InvalidParameterSpecException invalidParameterSpecException
* @throws InvalidParameterSpecException invalidParameterSpecException
*/
*/
public
static
AlgorithmParameters
generateIV
(
byte
[]
iv
)
throws
NoSuchAlgorithmException
,
InvalidParameterSpecException
{
public
static
AlgorithmParameters
generateIV
(
byte
[]
iv
)
throws
NoSuchAlgorithmException
,
InvalidParameterSpecException
{
...
@@ -46,9 +46,8 @@ public class AESUtil {
...
@@ -46,9 +46,8 @@ public class AESUtil {
*
*
* @param content 密文
* @param content 密文
* @return result
* @return result
* @throws Exception e
*/
*/
public
byte
[]
decrypt
(
byte
[]
content
,
byte
[]
keyByte
,
byte
[]
ivByte
)
throws
Exception
{
public
byte
[]
decrypt
(
byte
[]
content
,
byte
[]
keyByte
,
byte
[]
ivByte
)
{
initialize
();
initialize
();
try
{
try
{
Cipher
cipher
=
Cipher
.
getInstance
(
"AES/CBC/PKCS7Padding"
);
Cipher
cipher
=
Cipher
.
getInstance
(
"AES/CBC/PKCS7Padding"
);
...
...
src/main/java/com/gogirl/infrastructure/util/WXCore.java
View file @
fd3b77da
...
@@ -23,7 +23,7 @@ public class WXCore {
...
@@ -23,7 +23,7 @@ public class WXCore {
String
sessionKey
,
String
sessionKey
,
String
iv
)
throws
InvalidAlgorithmParameterException
{
String
iv
)
throws
InvalidAlgorithmParameterException
{
String
result
;
String
result
;
AES
aes
=
new
AES
();
AES
Util
aes
=
new
AESUtil
();
byte
[]
resultByte
=
aes
.
decrypt
(
Base64
.
decodeBase64
(
encryptedData
),
byte
[]
resultByte
=
aes
.
decrypt
(
Base64
.
decodeBase64
(
encryptedData
),
Base64
.
decodeBase64
(
sessionKey
),
Base64
.
decodeBase64
(
iv
));
Base64
.
decodeBase64
(
sessionKey
),
Base64
.
decodeBase64
(
iv
));
if
(
null
!=
resultByte
&&
resultByte
.
length
>
0
)
{
if
(
null
!=
resultByte
&&
resultByte
.
length
>
0
)
{
...
...
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