Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
safe6Sec committed Jul 9, 2022
1 parent 6c0641a commit 27237e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.76</version>
<version>2.0.7</version>
</dependency>


Expand Down
1 change: 1 addition & 0 deletions src/main/java/cn/safe6/util/HttpTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ public static boolean downloadFile(String downURL, String path) throws Exception
public static Request parseRequest(String body) {
Request request = new Request();
body = body.trim();
body = body.replace("cookie","Cookie");
String[] parts = body.split("\r\n\r\n|\r\r|\n\n");
if (parts.length < 2) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cn/safe6/util/PayloadEncryptTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
public class PayloadEncryptTool {

public static String AesGcmEncrypt(byte[] plainText,String key) throws Exception{
byte[] k = java.util.Base64.getDecoder().decode(key);
byte[] k = Base64.decode(key);
AesCipherService aes = new AesCipherService();
ByteSource initciphertext = aes.encrypt(plainText, k);
return String.valueOf(initciphertext);
}


public static String AesCbcEncrypt(byte[] plainText,String key) throws Exception {
byte[] k = java.util.Base64.getDecoder().decode(key);
byte[] k = Base64.decode(key);
byte[] ivBytes = new byte[16];
SecureRandom random = new SecureRandom();
random.nextBytes(ivBytes);
Expand Down

0 comments on commit 27237e7

Please sign in to comment.