WebClub-NITK / Hacktoberfest-2k18

Repository for Hacktoberfest 2018 open for the global open source community.
https://webclub-nitk.github.io/Hacktoberfest-2k18/
19 stars 104 forks source link

Create OneTimePad.java #249

Closed KshitijMhatre closed 5 years ago

KshitijMhatre commented 5 years ago

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