Rail Fence Cipher:
·
Key and String as argument parameter from user,
o
=encode(input string, key)
o
=decode(encoded string, key)
·
If the user enters 2 then
o
There will be 2 rows:
o
fn encode_P1 ("MESSAGE IS THIS",2) will modify the input as:
MSAEI
HSESG STI
M
|
S
|
A
|
E
|
I
|
H
|
S
|
||||||||
E
|
S
|
G
|
S
|
T
|
I
|
o
fn decode_P1 ("MSAEI HSESG STI",2) will print the output as:
MESSAGE IS THIS
·
If the user enters 3 then
o
There will be 3 rows:
o
fn encode_P1 ("MESSAGE IS THIS",3) will modify the input as:
MAIHESG STISE S
M
|
|
|
|
A
|
|
|
|
I
|
|
|
|
H
|
|
|
|
E
|
|
S
|
|
G
|
|
|
|
S
|
|
T
|
|
I
|
|
|
|
S
|
|
|
|
E
|
|
|
|
|
|
|
|
S
|
o
fn decode_P1 ("MSAEI HSESG STI",3) will print the output as:
MESSAGE
IS THIS
Caesar Cipher:
Eg. MESSAGE IS NOT THIS.
· fn
encode_P2("MESSAGE IS NOT THIS",3) will offset it by 3 ASCII characters.
Output: PHVVDJH#LV#QRW#WKLV
fn
decode_P2("PHVVDJH#LV#QRW#WKLV",3) will return the original statement.
Output: MESSAGE IS NOT THIS
Please put your thoughts and comments below so that I can improve.
THANKS EVERYONE.
SUBHAJIT.