0% found this document useful (0 votes)
352 views

Practical No. 8: Theory

The document describes a program to implement the Rail Fence cipher technique for encryption. The Rail Fence technique works by writing the plain text message in diagonals and reading the cipher text by reading the letters written in the diagonals as rows. The program takes a plain text message as input, arranges it in a rail fence pattern according to the number of rails entered, and outputs the encrypted cipher text.

Uploaded by

Kaveri zanzane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
352 views

Practical No. 8: Theory

The document describes a program to implement the Rail Fence cipher technique for encryption. The Rail Fence technique works by writing the plain text message in diagonals and reading the cipher text by reading the letters written in the diagonals as rows. The program takes a plain text message as input, arranges it in a rail fence pattern according to the number of rails entered, and outputs the encrypted cipher text.

Uploaded by

Kaveri zanzane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Name : kaveri zanzane

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.

L.Relevant Program Outcomes:


PO1 Basic Knowledge: -Apply Knowledge of basic Mathematics, science and
basic engineering to solve the broad based Computer Engineering Problems. PO
2 Discipline Knowledge: - Apply Information Technology Knowledge to solve
broad based Information Technology Related Problems.
PO 3 Experiments & Practice: Plan to perform Experiments and practice and to
use the results to solve Information Technology Related Problems.
PO 4 Engineering Tools: -Apply Appropriate Information Technology related
Techniques/tools with understanding of the limitations.
PO9 Communication- Communicate effectively in oral and written form.
PO 10 Life Long Learning - Engage in independent and lifelong learning
along with the technological changes also in the IT and Allied Industry

III. Relevant Course Outcomes


Apply Cryptographic algorithms and protocol to maintain Computer Security.

IV. Practical Outcomes


Write a program to implement Rail Fence Technique.

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.

VI. Practical Related Questions


Explain advantages and disadvantages of Rail Fence Technique.
Using Rail Fence Technique calculate cipher text for given Plain Text.
Plain text =EVERYTHING IS POSSIBLE.
Write a C/CPP/Java program to implement Rail Fence Technique. (Add
screen shots of program as well as output)
Teactica0 8 J gi te a Yeoqea1 o irmT9emen
Kao0 Fence Technique
MAEER'S MIT Polytechnic, Pune-38

OdekarloorRai0Fertce Jechnique_alqo2ithi aßonq


witM Orte edany 9e
aTHe Kadl Fence echnique ig Teanazogitiorn lechnique
bLH Hhis 0aon teay Me88aqe 3 2ihen a8 a 3equenne
dbaqoHalg & Ho qot cihe2 teat 20ad H1e
a o n Hedt w2iken i deagorta asa gequerlce o 2owg
kzamrQe
0aorteal Con1e Horte tomo22 OLD
AQLange laonext as3 0queHce edoaaonal as

h m m

NO 22ad as3equence d eow


ihe2 teat CImh mt m 200 eoe o 0 L

p21D6idq hag tence_Algogithmechnique caQcu cte


Ciphez teat 0_aiven TOan Tes

T0an texy- MI YOJYYE CHN LC


A22ange a o earai 8equence odiaqonal as
M H

N
ciphe2 teatz MIOYE HIIPLTCNc
MAEER'S MIT Polytechnic, Pune-38
2actita 0 Kelaed Quei-

apaorn_adyontages di6adxantoa.qes ohoo0 Eernce


Yechnique
Advar aqes
0THeei5 Na0clediskarlce e (O13eCD tive PtPe25
nerl9 tHe 0ethe ps Heed Ho Oe a?eanga in
KqZA HC ided yegtica0_La0urn9 Hhat descend
uP it can be a22ar1qed n a
ziqz.aq hmannee
Thezelo2ehia inctease5 diitultu- achirta Code
l)Tis quote easy p a3 20.ces ikis 0egs
o e to rMiSYake 6

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

921DGing Kaoteme echnique cal.co0


qiVen Yoa@n teat
ate_cSzhep fex
oa

0or teat EVEKyHINGT06515 LE


MAEER'S MIT Polytechnic, Pune-38

ARatge0ao teat as 3equence_o dicgBAm diaqortal

E E H N 5

NoW 2ead as 8equeMCe O|


(ihe2 tet EEYHNYTSILYKILG605BE

e i t e C[crELTavaTeoqean Yoirlenien Koad0


eMce Technique (A dd 32eenahot6)
it Apps
WhatsApp Web GitHiub -
atulapralE Android Programs Article Rewriter Too.. IRJET-VBI7457 pdf TanSiewChing 1287..
Run DebugStep Share HSave0Beautiy Language C
OnlineGDB eta

online compler and debugger for c l c


main.c

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

online compler and debugoer for c l c


strcpy(codel}[S51, stri51)D
code[i][i (int)str[il:
code. compile. run debug share
j+
DE

y Projects
else
Classroom n

Learm Programming 6

Programming Questions 37 for (i-rails-2;i>0;i


sign Up code[i] [i] (int) str[il;
J
Login

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 ***

m.ain.c: In function main


Classroom main.c:9:5: warning: 'geta' in deprecated [-Wdeprecated-declarat ions ]
Learn Programming 9| g e t s (str)

Programming Questions Tn file included from main. c:l:

Sign Up /usr/include/stdio.h:577:14: note: declared here


577 char
extern
*gets (char _s)_wurattribute deprecated_i
Login
usr/bin/ld: /tmp/ccamB1xh.o: the
in functionfunetion
main' is dangerous and should be used.
main.cs (. text+0xie): warning: "geta" not

Entera SecreE Message


Everything is Poaaible
number ot raila
Enter
2
Eeyhn sPailvrtigi oabe

Progran finished with code 0


exit
Press ENTER to exit console.|

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

You might also like