How to generate secret key in Java once and use that key in 2 different programs
问题 My aim is to write a Java program to encrypt a text file ( cipher text ) using AES algorithm . And then, write another program to decrypt that encrypted file ( cipher text ) to get the plain text back. I want to use same key (same key, generate once, save it somewhere, and use it in both encryption and decryption program) for encryption and decryption process. If I generate key and do the encryption and decryption line by line in the same program then it works perfectly. Here is the working