Below are the guide for setting up ruby on linux machine and running a ruby program. Note that everything is done in terminal.
-
Install ruby:
sudo apt-get install ruby-full
-
Change the current directory to CS-Assignment:
cd CS-Assignment
-
Run bundler:
bundle install
To run Encyption System in interactive
mode, run the following code.
ruby q3.rb -i
ruby q3.rb -h
ruby q3.rb -n abc -e krkr
Above command will read input from file with name abc and will run key, railfence, key , railfence cipher on the input in that order
-i, --[no-]interactive turn on interactive mode
-e, --encryption-method defines what encryption and in what order [ k - key cipher ] [ r - railfence ]
-n, --input-filename input file to process
-o, --output-filename output file for encrpyted
-r, --rf-key 123 key for railfence
-k, --ky-key kappa key for key cipher
-t, --text text to encrypt
-h, --help Show this message
-v, --version Print version