github-advanced-security[bot] commented on code in PR #5436:
URL: https://github.com/apache/shenyu/pull/5436#discussion_r1485863046
##########
shenyu-sync-data-center/shenyu-sync-data-http/src/main/java/org/apache/shenyu/sync/data/http/AccessTokenManager.java:
##########
@@ -132,6 +141,30 @@
}
}
+ /** aes encrypt data.
+ *
+ * @param secretKeyStr secretKeyStr
+ * @param ivStr ivStr
+ * @param data data
+ */
+ private String encrypt(final String secretKeyStr, final String ivStr,
final String data) {
+ String encryptStr;
+ byte[] secretKeyBytes = secretKeyStr.getBytes();
+ byte[] ivBytes = ivStr.getBytes();
+ try {
+ SecretKey secretKey = new SecretKeySpec(secretKeyBytes, "AES");
+ IvParameterSpec ivParameterSpec = new IvParameterSpec(ivBytes);
+ Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
Review Comment:
## Use of a broken or risky cryptographic algorithm
Cryptographic algorithm [AES/CBC/PKCS5Padding](1) is weak and should not be
used.
[Show more
details](https://github.com/apache/shenyu/security/code-scanning/53)
##########
shenyu-register-center/shenyu-register-client/shenyu-register-client-http/src/main/java/org/apache/shenyu/register/client/http/HttpClientRegisterRepository.java:
##########
@@ -152,6 +162,31 @@
}
}
+
+ /** aes encrypt data.
+ *
+ * @param secretKeyStr secretKeyStr
+ * @param ivStr ivStr
+ * @param data data
+ */
+ private String encrypt(final String secretKeyStr, final String ivStr,
final String data) {
+ String encryptStr;
+ byte[] secretKeyBytes = secretKeyStr.getBytes();
+ byte[] ivBytes = ivStr.getBytes();
+ try {
+ SecretKey secretKey = new SecretKeySpec(secretKeyBytes, "AES");
+ IvParameterSpec ivParameterSpec = new IvParameterSpec(ivBytes);
+ Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
Review Comment:
## Use of a broken or risky cryptographic algorithm
Cryptographic algorithm [AES/CBC/PKCS5Padding](1) is weak and should not be
used.
[Show more
details](https://github.com/apache/shenyu/security/code-scanning/52)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]