Java Cryptography, Java, Java Interview, Rsa Algorithm, Aes Algorithm.
keyPairGenerator.initialize(2048); // Adjust key size as needed return keyPairGenerator.generateKeyPair(); } public static void main(String[] args) throws NoSuchAlgorithmException { KeyPair keyPair = generateKeyPair(); System.out.println("RSA Public Key: " + keyPair.getPublic());