Skip to content

Commit 19ef25c

Browse files
authored
Update ExampleAsymmetricStringEncryption.java
1 parent 22696f2 commit 19ef25c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/cryptoexamples/java/ExampleAsymmetricStringEncryption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void main(String[] args) {
3434
KeyPair keyPair = keyPairGenerator.generateKeyPair();
3535

3636
// ENCRYPTION
37-
Cipher cipher = Cipher.getInstance("RSA/None/OAEPWithSHA-256AndMGF1Padding");
37+
Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
3838
cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic());
3939

4040
byte[] cipherTextBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));

0 commit comments

Comments
 (0)