moremind commented on code in PR #5436:
URL: https://github.com/apache/shenyu/pull/5436#discussion_r1495256174


##########
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/DashboardUserServiceImpl.java:
##########
@@ -319,7 +337,25 @@ public boolean checkUserPassword(final String userId) {
         
         return true;
     }
-    
+
+    private String aesDecodePassword(final String password) {
+        String encodedPassword = null;
+        try {
+            String key = secretProperties.getKey();
+            String iv = secretProperties.getIv();
+            Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding");
+            SecretKey secretKey = new 
SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), "AES");
+            IvParameterSpec ivParameterSpec = new 
IvParameterSpec(iv.getBytes(StandardCharsets.UTF_8));
+            cipher.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec);
+            byte[] decryptedBytes = 
cipher.doFinal(Base64.getDecoder().decode(password));
+            encodedPassword = new String(decryptedBytes);
+        } catch (Exception e) {
+            LOG.error("AES decode error", e);

Review Comment:
   throw exception include message



-- 
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]

Reply via email to