I. Initial Step (Prepare the program):
- Open a shell terminal and navigate to RSA_Encryption directory.
- Compile the java classes, use the following command:
javac RSA.java EncryptionDriver.java DecryptionDriver.java
II. For Encryption:
- Please use the file named file.txt (if not found, make one) located in "files" directory and include the following: - The first line must contains the public keys e and n respectively, seperated be aspace. - The second line onward contains the text to by encrypted, you may use a newline, space, and any of the these characters. ('.', '?', '!', ',', ';', ':', '-', '(', ')', '{', '}', '[', ']', single quotes, double quotes)
- Run EncryptionDriver, to do that use the following command.
java EncryptionDriver
- The encrypted text will be in files/file.rsa file.
III. For Decryption:
- Use the file named file.rsa (if not found, make one) located in "files" directory, and include the following:
- The encrypted text (without white spaces) consisting of only numbers.
- Run DecryptionDriver, to do that use the follwing command:
java DecryptionDriver
- To decrypt the sample file.txt provided use d = 2832537816223, n = 99808491759239.
- The decrypted file will be in files/file.dec file.
Please note: In order for the program to run successfully, it is important to include the required text file to be encrypted in "files" directory, and it must be named as "file.txt".