From cd5c7e86ccbe1f03c7b63f6da1ef37a187392eae Mon Sep 17 00:00:00 2001 From: aaron-kumar Date: Sun, 27 Aug 2023 00:16:28 +0530 Subject: [PATCH] Fixed Use of a cryptographic algorithm with insufficient key size --- .../java/network/oxalis/statistics/security/EncryptionTest.java | 2 +- .../java/network/oxalis/statistics/security/SignatureTest.java | 2 +- .../main/java/network/oxalis/test/security/CertificateMock.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/EncryptionTest.java b/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/EncryptionTest.java index 34a965fb9..66f5cecfd 100644 --- a/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/EncryptionTest.java +++ b/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/EncryptionTest.java @@ -49,7 +49,7 @@ public class EncryptionTest { @BeforeClass public void createKeyPair() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); - keyPairGenerator.initialize(1024); // Medium security is fine + keyPairGenerator.initialize(2048); // Medium security is fine keyPair = keyPairGenerator.generateKeyPair(); KeyGenerator keyGenerator = KeyGenerator.getInstance("DES"); diff --git a/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/SignatureTest.java b/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/SignatureTest.java index 08e254517..0978db254 100644 --- a/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/SignatureTest.java +++ b/oxalis-legacy/oxalis-statistics/src/test/java/network/oxalis/statistics/security/SignatureTest.java @@ -99,7 +99,7 @@ private byte[] encrypt(KeyPair keyPair) throws NoSuchAlgorithmException, NoSuchP private KeyPair generateKeyPair() throws NoSuchAlgorithmException, NoSuchProviderException { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA"); SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG", "SUN"); - keyPairGenerator.initialize(1024, secureRandom); + keyPairGenerator.initialize(2048, secureRandom); return keyPairGenerator.generateKeyPair(); } diff --git a/oxalis-test/src/main/java/network/oxalis/test/security/CertificateMock.java b/oxalis-test/src/main/java/network/oxalis/test/security/CertificateMock.java index 20dcf5d8f..6ddffe5dc 100644 --- a/oxalis-test/src/main/java/network/oxalis/test/security/CertificateMock.java +++ b/oxalis-test/src/main/java/network/oxalis/test/security/CertificateMock.java @@ -44,7 +44,7 @@ public class CertificateMock { public static X509Certificate withCN(String cn) { try { KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA", "BC"); - keyPairGenerator.initialize(1024, new SecureRandom()); // No ment to be secure! + keyPairGenerator.initialize(2048, new SecureRandom()); // No ment to be secure! KeyPair keyPair = keyPairGenerator.generateKeyPair();