Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit 9f280f7

Browse files
committed
Undo experiments
1 parent 6751836 commit 9f280f7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/org/codehaus/plexus/components/cipher/internal/PBECipher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Licensed to the Apache Software Foundation (ASF) under one
2222
import javax.crypto.Cipher;
2323
import javax.crypto.NoSuchPaddingException;
2424
import javax.crypto.SecretKeyFactory;
25-
import javax.crypto.spec.GCMParameterSpec;
25+
import javax.crypto.spec.IvParameterSpec;
2626
import javax.crypto.spec.PBEKeySpec;
2727
import javax.crypto.spec.SecretKeySpec;
2828

@@ -49,7 +49,7 @@ public class PBECipher {
4949
protected static final int SALT_SIZE = 8;
5050
protected static final int CHUNK_SIZE = 16;
5151
protected static final String KEY_ALG = "AES";
52-
protected static final String CIPHER_ALG = "AES/GCM/NoPadding";
52+
protected static final String CIPHER_ALG = "AES/CBC/PKCS5Padding";
5353
protected static final int PBE_ITERATIONS = 310000;
5454
private static final SecureRandom _secureRandom = new SecureRandom();
5555

@@ -137,7 +137,7 @@ private Cipher createCipher(final char[] pwd, byte[] salt, final int mode)
137137

138138
Cipher cipher = Cipher.getInstance(CIPHER_ALG);
139139

140-
cipher.init(mode, new SecretKeySpec(key, KEY_ALG), new GCMParameterSpec(128, iv));
140+
cipher.init(mode, new SecretKeySpec(key, KEY_ALG), new IvParameterSpec(iv));
141141

142142
return cipher;
143143
}

src/test/java/org/codehaus/plexus/components/cipher/internal/DefaultPlexusCipherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class DefaultPlexusCipherTest {
3434

3535
final String str = "my testing phrase";
3636

37-
final String encStr = "cQupsZrOFpkGa7Ce/vdwr3a0Zun/X5VHsqXhnZOnhKB6VtTu7mfyI5gtycUsG3Fy";
37+
final String encStr = "RRvejxJ+wksH/kWnYfun/GeFoPKh6JHcA2dmxMOIraZiIuLISplmdyvl2Sq04rpP";
3838
PlexusCipher pc;
3939

4040
@BeforeEach

src/test/java/org/codehaus/plexus/components/cipher/internal/PBECipherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class PBECipherTest {
3434

3535
final String clearText = "veryOpenText";
3636

37-
final String encryptedText = "ce/l2ofOiSELRT1WAjOyNoZbG+2FQcrlOKEdDr5mi6esyR2LfvBY855yxW5bqHZi";
37+
final String encryptedText = "xnQ1RvJFoJsHoTZKyv76ej3XTGKt99ShUt/kPv4yHjw=";
3838

3939
final String password = "testtest";
4040

0 commit comments

Comments
 (0)