mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-11 08:54:00 +00:00
chore(vulnerability): Risky Cryptographic Algorithm (#11059)
This commit is contained in:
parent
aeef69cbaf
commit
2c9e3b74ed
@ -25,7 +25,7 @@ public class SecretUtils {
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
Cipher cipher = Cipher.getInstance("AES");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
|
||||
return Base64.getEncoder()
|
||||
.encodeToString(cipher.doFinal(value.getBytes(StandardCharsets.UTF_8)));
|
||||
@ -48,7 +48,7 @@ public class SecretUtils {
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
|
||||
Cipher cipher = Cipher.getInstance("AES");
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey);
|
||||
return new String(cipher.doFinal(Base64.getDecoder().decode(encryptedValue)));
|
||||
} catch (Exception e) {
|
||||
|
@ -50,7 +50,7 @@ public class SecretService {
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
Cipher cipher = Cipher.getInstance("AES");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
|
||||
return _encoder.encodeToString(cipher.doFinal(value.getBytes(StandardCharsets.UTF_8)));
|
||||
} catch (Exception e) {
|
||||
@ -72,7 +72,7 @@ public class SecretService {
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
|
||||
Cipher cipher = Cipher.getInstance("AES");
|
||||
cipher.init(Cipher.DECRYPT_MODE, secretKey);
|
||||
return new String(cipher.doFinal(_decoder.decode(encryptedValue)));
|
||||
} catch (Exception e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user