This program prompts to take two lines of input i.e, plaintext and otp key. It uses calculates one time padded string as sum of index of character mod 26 and outputs the ciphered text.
How to run
on Terminal/cmd
$javac OneTimePad.java
$java OneTimePad
Sample input outputs
$java OneTimePad
Input plain text and OTP key on seperate lines
quizzingisfun
tequilamockingbird
One time padded cipher text:
jyythtnswupca
$java OneTimePad
Input plain text and OTP key on seperate lines
hello
goodbye
One time padded cipher text:
nszop
$java OneTimePad
Input plain text and OTP key on seperate lines
hello
xmckl
One time padded cipher text:
eqnvz
$java OneTimePad
Input plain text and OTP key on seperate lines
aoehaufhaeiufhafiuhefiuhewfieauhfliuaewfheakljfhaewjklfhawelfaew
awecuauncauecaeanekcajenckauaekuwcnaweucnewiucnalwnicuaewclnaecunelc
One time padded cipher text:
akijuuzucecyhhefvyrgfryuggfceeebbnvuwiqhuiwsflshlajrmfflwypyfegq
$java OneTimePad
Input plain text and OTP key on seperate lines
abcdefghijklmnopqrstuvwxyz
ueacnileuncawlicnaeilucniewuicn
One time padded cipher text:
ufcfrnrlcwmliywrdrwbfpykgd
Checklist
[x] Code compiles correctly.
[x] Changes are tested properly.
[x] Added the README / documentation, if necessary.
Resolves Issue #217
Description
This program prompts to take two lines of input i.e, plaintext and otp key. It uses calculates one time padded string as sum of index of character mod 26 and outputs the ciphered text.
How to run
on Terminal/cmd $javac OneTimePad.java $java OneTimePad
Sample input outputs
$java OneTimePad Input plain text and OTP key on seperate lines quizzingisfun tequilamockingbird
One time padded cipher text: jyythtnswupca
$java OneTimePad Input plain text and OTP key on seperate lines hello goodbye
One time padded cipher text: nszop
$java OneTimePad Input plain text and OTP key on seperate lines hello xmckl
One time padded cipher text: eqnvz
$java OneTimePad Input plain text and OTP key on seperate lines aoehaufhaeiufhafiuhefiuhewfieauhfliuaewfheakljfhaewjklfhawelfaew awecuauncauecaeanekcajenckauaekuwcnaweucnewiucnalwnicuaewclnaecunelc
One time padded cipher text: akijuuzucecyhhefvyrgfryuggfceeebbnvuwiqhuiwsflshlajrmfflwypyfegq
$java OneTimePad Input plain text and OTP key on seperate lines abcdefghijklmnopqrstuvwxyz ueacnileuncawlicnaeilucniewuicn
One time padded cipher text: ufcfrnrlcwmliywrdrwbfpykgd
Checklist