|
- import java.math.BigInteger;
-
- public class Main {
- static BigInteger cipher (BigInteger message, BigInteger key, BigInteger module) {
- return message.modPow(key, module);
- }
- public static void main(String[] args) {
- BigInteger prime = Prime.generate(32);
- System.out.println("Finished - number is "+prime);
- RSA test = new RSA (32);
- test.createKeys();
- System.out.println(String.format("public key: 0x%X", test.getPublicKey()));
- System.out.println(String.format("private key: 0x%X", test.getPrivateKey()));
- System.out.println(String.format("RSA module: 0x%X", test.getRSAModule()));
- }
- }
|