You are on page 1of 11

Name : kaveri zanzane

Roll no :21

Practical No. 9

Aim: Write a program to implement Simple Columnar Transposition Technique

Theory:
L Practical Significance
Cryptography is the art and science of achieving security by encoding messages to make
them non-readable. Simple Columnar Transposition Technique is Transposition
Technique.

IL. Relevant Program Outcomes:


.PO 1 Basic Knowledge: -Apply Knowledge of basic Mathematics, science and
basic engineering to solve the broad based Computer Engineering Problems.
PO2 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-Communicateeffectively in oral and writen form.
PO 10 Life Long Learning - Engage in independent and lifelong learning along
with the technological changes also in the IT and Allied Industry

II. Relevant Course Outcomes


Apply Cryptographic algorithms and protocol to maintain Computer Security.

IV. Practical Outcomes


Write a program to implement Simple Columnar Transposition Technique.

. Theory
Explain Simple Columnar Transposition Technique algorithm along with one

example of your choice.


.Using Simple Columnar Transposition Technique calculate cipher text for given
Plain Text.
Plain text =MIT POLYTECHNIC.
Keyword = Hello

VI. Practical Related Questions


.Explain advantages and disadvantages of Simple Columnar Transposition
Technique.
Using Simple Columnar Transposition Technique calculate cipher text for given
Plain Text.
Plain text = EVERYTHING IS POSSIBLE.
Keyword = MIT POLY
Write a CCPP/Java program to implement Simple Columnar Transposition
Technique. (Add screen shots of program as well as output)
Teactica09:- Meite Troqtam toîmp0e mernt 8impo0e
Co0o mnae Tran3 7o 3ition TechniquMAEERSs MIT Polytechnic, Pune-38

Theo?uSimy9e
a T 0abn'tolomnae fanstrosi tiort TechMique algozi Phm
a0orq withO1e eda79e
iuT0einp co0o mnagpanazosirion echnique he ie83aqe
LwgiHen out o 20w6 o dod Lengh Pn
2ecldout auqao o9om1 uco0.on1n & coOum15a2e_
C10se1 in gorme 3C2am00ed 02d e8 oH1 widh
OROL6 pe2Autatian5 olcolumd are u3ua00u
delinecdou keuuwotc
Eaam 0e
Keuwozd- Zeo2as
Me33cLqe we CL cliscoy.e ed 0ee_at orlte

2 5
W E D
5
E D
N C
E E

Trovid.inq nulls15) =QkJ EU)

Liphe2Teat: EVLNE ACDYKE6EM ROEOT


D tECU WIREE
MAEER'S MIT Polytechnic, Pune-38
Dginq 6i170e Co0ortnaeeatsyo8iiO echnique
CaQcuoate ciphe2 tex o2 givert FLain Tea
Foaont eat: MLI POYYELHN LC
KeywoRd He0Q o 45
M

H NI C
M
2avididg nu00(1) )
H N
Liphez healt
A IYN M;H 1TI
FEC 6Cx

eactica0KeQaked Que
1 Eap Qai Advantages DiaadvanyaaegoSinz l e
LO0um1a2 Y2ang roairion Bechnique.
dvanta.qe6
aHas miainq.a0etke2.3 han 8Ame tiyHre
bTHe maRn Denelit hat '2an3zosirion úphe2 haxe
aYe2-
800sPi+otion ciyhe? is hat 2ans-pasitiarn
lpheg_Lan e
a lied 110fe a n Once
DisadxanBages
Cat ecLgi0y be_cleLip He Red i cuasSma me38aqe

o2 U31nq 8imT cO0u.mna12an3ositiorztechniQue


LaOcuOcAEe Cphe2.Hex 02 qiven ylaon tett
MAEER'S MIT Polytechnic, Pune-38

Ylaod t eatb =FyLRYTHIN 15 06618 LE


Keuuatd: MIY ToLY
1 6 5
E Y E Y
N C O
LE A

I2oNidiq ru0.0 (1) A

Ciphee tealt y N TE EI5 5L RIE EGL


HaA

O3 leite C/cHEUara T 20q20r to im0 ement


3ity
0e_co0umrna? Teang rositio Technique
Onlineccompuler -onine editor X

CGonlinegdb.com/online.c.compiler
i Apps WhatsApp Web GitHub- atulapra/E. Android Programs Article Rewriter Too IRJET-VBI7457,pdt TanSiewChing1287
R u n O DebugStopC Share HSave () Beaudily Language C+
OnlineGDB bta main.cpp
online compiler and debugger for cic
1#nclude<iostream>
2 include <regex
code compile. run debug. share
3 #include <string
1DE 4 #include <sstream>
5 using namespace std;
My Projects
string
int
getNumberLocation (string keyword, string kywrdNumlistStr) {
Classroom nw
kywrdNumList[keyword. lengthO]; .

Learn Programming
for (int i = 0; i < sizeof(kywrdNumList) /sizeof(kywrdNumList[®]); i+
kywrdNuml.ist[i] =kywrdNumL istStr[i] -48;
Programming Questions
string numLoc

Sign Up f o r i n t i = 1; i < keyword.length() 1 i

Login
5 for

(int i 0 ; j<keyword.length (); j++) {


if
(kywrdNumList [j ] - i){
numLoc+
to string (i);
f return numLoc;

9
string keywordNumAssign(string keyword){
string alpha= "ABCDEFGHIJKLMNOPORSTUVKYZ";
int kywrdNuml ist [keyword. length()];
1nt
nit
for (int i =0; i < alpha. length (); i +
24 for (int i 0; j < keyword. length() ; j){
if (alpha[i] = keyword [i]) {
1nit
kywrdNumList[5] = init; Activate Windows
About FA0 Blog Tems of Use - Contact Us
Go to PC settings to activate Windows.
GDB Tutorial Credits Privacy
input
D 2016-2022 GDB Oniline
ENG 13:44
x US 15-04-2022
OnlineC Compiler-online editor X

CGonlinegdb.com/online.c.compiler
i Apps WhatsApp Web GitHub- atulapra/E. Android Programs Article Rewriter Too IRJET-VBI7457,pdt TanSiewChing1287
OnlineGDB beta Run O DebugStopC Share H Save ()Beautify Language C+
main.cpP
online compiler and debugger for cice+ KywraNumistiJj nit;

code compile. run debug, share


string str =
1DE
for
(int i 05 i sizeof (kyurdNumList)/sizeof(kywrdNiumL.ist[0]); i+
str +

to_string (kywrdNumList [il);


My Projects
return sth
Classroom nw

Learn Programming 35 void cipherEncryption)

Programming Questions
string
cout <
"Enter Plain Text:
"
Sign Up getline(cin, msg) i
string keyword;
Login
cout "Enter Keyword:
getline(cin, keyword);
f for msg[i] i
(int i ==toupper
0; < msg.length);
(msg[i]);
i**){

msgregex_replace(msg, regex(s
length(); i++){
.
1
< keyword.
keyword [i] = toupper (keyword [i);
for
(int i
cout
=
0, i <keyword.length (); it+)
58
<< keyword[i] <* "*s

cout endl;

string
int
kyurdNumListstr keywordNumAssign(keyword) ;
=

Activate Windows
for (int i =0; i[ keyword.
kywrdNumList length()];
About FAQ Blog- Terms of Use - Contact Us
Go to PC settings to activate Windows.
GDB Tutorial Credts Privacy < sizeof (kywrdNumList)/sizeof (kywirdNumList[0); i
D 2016-2022 GDB Oline input
ENG 13:44
) US 15-04-2022
x
OnlineCcompiler - online editor
7C onlinegdb.com/online_c_compiler

ii Apps
WhatsApp Web GitHub- atulapra/E.
Android Programs Article Rewriter Too.IRJET-VBI7457.pdf TanSiewChing1287.
Run DebugStop GShare H Save (0 Beautify Language C
OnlineGDB beta main.cpp
online compler and debugger for clc
for
(int i - 0; i< sizeof(kywrd NumL ist) /sizeof (kywrdNumlist[®1); i+)
cOde. compile. run. debug share
6
7
kywrdNumL ist [i] = kywrdNumListStr[i] 48;
IDE for (int
cout
i: kywrdNumList){
My Projects
Classroom new
1
int extraLetters msg.length() keyword.length();
int
Leam Programming
2
dummyCharacters keyword.length
if (extraletters t
() extraletters;
Programming Questions
5
for (int i = 0; i <dummyCharacters; i ) {
Sign Up
}}
Login int numofRowsmsg.length ()/ keyword. length ();
char arr[numOf Rows] [keyword length() 1; .

f int z
9

for (ant 0; i < numOfRows; i++)


for arr[i][il j <keyword. length () ; j++) {
(int j=®;= msglz];

cout < endl;


6 for i it+)
7
(it
for
i = e; c numofRows;
(int j -0 jckeyword.length O; j+)
*

cout
< arr[i][j] << *;
36 cout << endl;

About FAQ Blog Tems of Use Contact Us


Activate Windows
-
82 string cipherText
GDB Tutorial Credts Privacy Go to PC settings to activate Windows
2016-2022 GDB Online input
ENG 13:44
IS 15023077
Onineccompiler- online editDr X

CGonlinegdb.com/online.c.compiler
i Apps WhatsApp Web GitHub- atulapra/E Android Programs Article Rewriter Too IRJET-VBI74S7 pdt TanSiewChing1287
OnlineGDB beta Run ODebugStopC Share HSave () Beaudily Language C+
main.cpPP
oniline compler and debugoer for cic
string numLoc getNumberLocation (keyword, kyurdNumListStr);
34 cout numLoc
code compile. run debug. share << endl;
35 cout
endl;
i
IDE for (int nt
=0, k =0; i <numOfRows; itt, k+*) {

My Projects if (k =- keyword. length ()){


Classroom new
else t
Learn Programming d = numlLoc[k]
d
Programming Questions

Sign Up for (int i 0; j < numOfRows; j++) {


cipherText += arr[i][d];
Login
}}
cout cipherText;

180 void cipherDecryption(){


161 string msg;
102 cout Enter Cipher Text:
103
184
getline(cin, msg);S
string keywora
105
cout "Enter Keyword:
getline(cin, keyword) ;
107
for (int i =0; i < keyword. length (); i+){
108 keyword[i]- (keyword[i);
Activate Windows
About FAQ Blog- Terms
-GDB Tutorial
of Use -

Credits- Privacy
Contact Us
110 string kyurdNumL.istStr keywordNumAssign(keyword)
i n t kod JhumislkeDOdengtha-
Go to PC settings to activate Windows.
input
D 2016-2022 GDB Online
ENG 13:44
US 15-04-2022
Onlineccompuler -onine editor X

9C onlinegdb.com/online.c.compiler
i Apps WhatsApp Web GitHub- atulapra/E. Android Programs Article Rewriter Too IRJET-VBI7457,pdt TanSiewChing1287
OnlineGDB beta Run Debug StopShareHSave 0 Beauity LanguageC+
main.cpP
online compiler and debugger for clc++
int
111
kywrdNumL ist i[keyword. length()];
code compile. run. debug share
B12

113
for (int i =05
kywrdNumList[i]
sizeof(kywrdNumList)/sizeof(kywrdNumList[®]); i++)
=kywrdNumListStr[i]- 48;
1DE
int numofROMs = msg.length ( ) / keyword. length() ;
My Projects 116
117
Classroom nw char arr[numof Rows ] [keyord. length()1
Learn Programming
118
string numloc
i
getNunberLocat
0, k 0; i
ion (keyword, kywrdNuml istStr);
msg.length(); it*, k++) {
for (int
int d
= <
Programming Questions
121 if (k keyword. length ()){
Sign Up 122 k=
123 e else
Login
124 d = numloc[k];
125 d d-e';

127 (int j= 0; j numOfRows; j*, i+) {


arr[3][d] = msg[i];
136
131
132
135 cout << endl;
134 string plainText =
135 for (inti =0; i <numOfRowS; it){
136 for
int i 0 i <keyword.1length(); j){
137 plaintext += arrli]l31; Activate Windows
About FAQ Blog Tems of Use Contact Us
-
138 Go to PC settings to activate Windows.
GDB Tutorial Credts Privacy
input
D 2016-2022 GDB Oniline
ENG 15:45
) US 15-04-2022
OnlineC compileronline editorX
CGonlinegdb.com/online.c.compiler
i Apps WhatsApp Web GitHub- atulapra/E.. 8 Android Programs Article Revwriter Too. IRJET-VBI7457:pdf TanSiewChing1287
Run DebugStop GShare HSave 0 Beautify Language C+
OnlineGDB beta main.cpp
online compler and debugger ftor clc
131
code compile. run debug. share
133 cout < endl;
IDE 134 string plainText ="";
My Projects 135 for

(int i = e; inumOfRoWS; it){


Classroom w
136
137
for plainText
(int j =®;* i< keyword.length(); j+)
arr[i]51;
Learn Programming 138
"
139 cout "Plain Text: << plainText <<
endl;
Programming Questions 140
141 int main(U
Sign Up
142 cout "Columnar Transposition Cipher" << endl;
Login 143
cout "1. Encryption \n2. Decryption\nChoose(1, 2):
int choice;
"s
145 cin > choice;
1ab an.1gnore();
147
if (choice = 1){
148 cout endl<"Encryption" < endl;
149
150-
cipherEncryption);
else 1 (chote
cout endl endl;
<<
<Decryption" <
152
153
cipherDecryption()D
}else
154 cout endl <<
"Wrong Choice" <
endl;
155
156 etur

About FA0 Blog Tems of Use - Contact Us


157 Activate Windows
158 Go to PC settings to activate Windows.
GDB Tutorial Credts Privacy
input
D2016-2022 GDB Online
ENG 15:45
U S 15-04-2022
Online C Compiler - onine editor x

G onlinegdb.com/online.c_compiler
ii Apps WhatsApp Web GitHub- atulapra/E Android Programs IRJET-VB7457 podf
Artidle Rewriter To..
TanSiewChing1287..
Run ODebug StopGShareSave(0 Beautiy Language C+ e
OnlineGDB beta maln.o
online compler and debugger for
dc
cOde. compile:. run, debug. share input
Columnar Transpoaition Cipher
IDE . Encryption
2. DecrYPtion
My Projects hoose (l,2): 1

Classroom mew
Encryption
Enter Plain ia
Lean Programming Text: everything possible
Enter Keyword: mitpoly
Programming Questions OLY
3 16 5 4 27
Sign 2VER YTH
NGI8PO
Login
1504326

VNS'TPEEIS

Progran finished with exit code 0


Press ENTER to exit console -

About FAQ Blog Tems of Use - Cotact Us


Activate Windows
Go to PC settings to activate Windows.
GDB Tutorial Credits Privacy
O2016-2022 GDB Online

1345
) US 15-04-2022

You might also like