diff options
author | malarvizhi <malarvizhi.44@wipro.com> | 2021-03-18 00:40:11 -0700 |
---|---|---|
committer | krishna moorthy <krishna.moorthy6@wipro.com> | 2021-03-18 08:25:55 +0000 |
commit | ee02cbcfb07c7322b93399c80e50acd2b975ccbd (patch) | |
tree | 0f064bc04583c6a2f582897da4ce709e907c8b6f /cmso-service/src/main/java | |
parent | fa9a888eb79c4632b3a1afd97641b0554d086828 (diff) |
Fix weak cryptography issues
Issue-ID: OPTFRA-927
Signed-off-by: Malarvizhi Paramasivam <malarvizhi.44@wipro.com>
Change-Id: I9e48f7313a7f76bd431e17cebfc3c52bc7f91bda
Diffstat (limited to 'cmso-service/src/main/java')
-rw-r--r-- | cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java b/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java index 3f7a808..1b6488f 100644 --- a/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java +++ b/cmso-service/src/main/java/org/onap/optf/cmso/common/PropertiesManagement.java @@ -99,8 +99,8 @@ public class PropertiesManagement { }
private static final String encrypt(String key, String value) {
- try {
- byte[] bytesIV = new byte[16];
+ try{
+ byte[] bytesIV = new byte[12];
random.nextBytes(bytesIV);
IvParameterSpec iv = new IvParameterSpec(bytesIV);
SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
@@ -118,8 +118,8 @@ public class PropertiesManagement { private static final String decrypt(String key, String encrypted) {
try {
- byte[] bytesIV = new byte[16];
- random.nextBytes(bytesIV);
+ byte[] bytesIV = new byte[12];
+ random.nextBytes(bytesIV);
IvParameterSpec iv = new IvParameterSpec(bytesIV);
SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
Cipher cipher = Cipher.getInstance(transformation);
|