We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22696f2 commit 19ef25cCopy full SHA for 19ef25c
src/main/java/com/cryptoexamples/java/ExampleAsymmetricStringEncryption.java
@@ -34,7 +34,7 @@ public static void main(String[] args) {
34
KeyPair keyPair = keyPairGenerator.generateKeyPair();
35
36
// ENCRYPTION
37
- Cipher cipher = Cipher.getInstance("RSA/None/OAEPWithSHA-256AndMGF1Padding");
+ Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
38
cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic());
39
40
byte[] cipherTextBytes = cipher.doFinal(plainText.getBytes(StandardCharsets.UTF_8));
0 commit comments