Skip to content

Commit bf3240e

Browse files
committed
Fix test program
1 parent d4d211a commit bf3240e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/core/RSATest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package core;
22

33
import java.math.BigInteger;
4-
import java.util.Random;
54

65
/*
76
* A program that allows you to encrypt and decrypt messages with RSA.
@@ -14,13 +13,13 @@ public class RSATest {
1413
public static void main(String[] args) {
1514
RSAKeyPair keys = Cryptography.generateRSAKeys();
1615

17-
BigInteger plainText = BigInteger.probablePrime(32, new Random());
16+
String plainText = "Hello, world!";
1817
System.out.println("Message: " + plainText);
1918

2019
BigInteger cipherText = Cryptography.encrypt(plainText, keys.getPublicKey());
2120
System.out.println("Cipher: " + cipherText);
2221

23-
BigInteger decodedCipher = Cryptography.decrypt(cipherText, keys.getPrivateKey());
24-
System.out.println("Original text: " + decodedCipher);
22+
String decodedText = Cryptography.decrypt(cipherText, keys.getPrivateKey());
23+
System.out.println("Original text: " + decodedText);
2524
}
2625
}

0 commit comments

Comments
 (0)