Practical No. 8: Theory
Practical No. 8: Theory
Roll no :21
Practical No.8
Aim: Write a program to implement Rail Fence Technique.
Theory:
L. Practical Significance:
Cryptography is the art and science of achieving security by encoding messages to make
them non-readable. The Rail Fence Technique is Transposition Technique. In this plain
text message as is written as a sequence of diagonals and to get cipher text read the plain text
Written in diagonal as a sequence of rows.
V. Theory
Explain Rail Fence Technique algorithm along with one example.
Using Rail Fence Technique calculate cipher text for given Plain
Text.
Plain text =MIT POLYTECHNIC.
h m m
N
ciphe2 teatz MIOYE HIIPLTCNc
MAEER'S MIT Polytechnic, Pune-38
2actita 0 Kelaed Quei-
Di8adyanBaq6
a ) The 2eco2ity
otodeis dependent On theact tha
OCu7Panalyst olocs 11o Knotd fhe rethod
encuytion ence, onte the method oeM
i3 20kedthe Lode is 0gaKen RUytio
o02eady
0.38100e them
300.0¥ion6Cl20 80 S ria 00 HMat ceuptanalst
cad ty'a 00 Doy Hand
Heie02, ao0 Fetce ia
Pa3y t 2eaK
E E H N 5
1 #include <stdio.h>
2 #include<string.h>
code compile. run. detbug share.
3 #include<stdlib.h>
DE main ()
Projects 6 int
i,i,len, rails, count,code[100][10e0];
Classroom char str[1000];
("Enter a Secret Message \n" );
Learn Programming
(str)
Programming Questions lenstrlen(str);
p r i n t t E n t e r number of rails \n");
Sign Up in ("%d, &rails);
Login for(i-0;i<rails;it+)
for(j-0,j len;j++)
code[i] [i]-0;
20 count=0;
21
22 while(j<len)
23
24 if(count%2 --0)
25
26
for(i-0icrails;i++) Activate Windows
About FAQ Blog- Tems of Use Contact Us
GDB Tutorial Credits - Privacy
28 /strepy(code [i][i], str[i]) ; Go to PC settings to activate Windows
code[i][il-(int)strlils
2016-2022 GDB Online
G 20-03
it Apps WhatsApp Web GitHub-
atuiapra/E. Android Programs Articdle Rewriter Too
IRJET-VBI7457 pdf TanSiewChing1287.
OnlineGDB bet L
main.c
Run DebugSpCSharHSave (0Bautly Language C
y Projects
else
Classroom n
Learm Programming 6
f +79K
44 count*s
5
16
47 for(i-0;icrails; i+
6
for(j-0;j len; j+")
if(code[i][]!=0)
rinti (%c*, code[i] [i])
Activate Windows
About FAQ Blog Tems of Use- Contact Us 55 Go to PC settings to activate Windows.
GDB Tutorial Credts Privacy "\n");
O 2016-2022 GDB Onine
ENG 20:03
7 C onlinegdb.com/onlineccompiler
#
AppsWhatsApp Web O GitHub-
atulapraE Android Programs Artcle Rewriter Too IRET-VBI7457.pdf
TanSiewChing1287.
OnlineGDB Beta R u m DebugStop C Share HSave ) Beautily Language C
main.c
online compiler and debugger for clce 23
istrcpy codelilLil,str[51) ;
code. compile. run. debug share code[i][il-(int)str[i
input
IDE
4 | main )
My Projects ***
Activate Windows
About FAQ Blog Tems of Use Cotact Us
Go to PC settings to activate
GDB Tutorial Credits Privacy WindowS
O 2016-2022 GDB Online
ENG 203
)EUus 14-04-2022