To use this code, go to the Ecrypt_Decrypt Directory:
javac Main.javaYou ll see in the
Ecrypt_DecryptDirectory.classof all classes.
-alg: To choose the which algorithm; we'veshiftorunicode. if we didn't specifie by default it will useshiftAlgorirthm.-mode: To choose the mode;encordec. If we didn't specifie by default it will useencmode.-data: To set the data to encrypt or decrypt.-key: To set the key to encrypt or decrypt. If we didn't specifie by default it will use0as a key.-in: To set the Input file to read data from which will be encrypt or decrypt. If we've both-inand-datawe choose-dataover-in.-out: To set the Output file to write the result. If we don't have both-outwe print the result to the standard output.
As you will see in the examples the order of the parameters is not important.
- Exemples for running the Main :
java -cp . Main -alg unicode -mode enc -key 5 -in input.txt -out protected.txt java -cp . Main -mode ENC -data "Hello There!" -out protected.txt -key 5 java -cp . Main -mode dec -in protected.txt -out decrypted.txt -key 5 -alg shiftjava -cp . Main -mode ENC -data "Hello There!" -key 5 -alg unicode