0% found this document useful (0 votes)
48 views5 pages

PR 5

The document describes a practical on implementing the Caesar cipher encryption and decryption algorithm. It includes the objectives of understanding and implementing the cipher, as well as the relevant concepts, outcomes, procedure, program code, and questions. The Caesar cipher involves shifting each letter by a fixed number of positions in the alphabet, either for encryption or decryption depending on the key. Students are to create a program that encrypts and decrypts messages using the Caesar cipher technique.

Uploaded by

jivanlad22
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)
48 views5 pages

PR 5

The document describes a practical on implementing the Caesar cipher encryption and decryption algorithm. It includes the objectives of understanding and implementing the cipher, as well as the relevant concepts, outcomes, procedure, program code, and questions. The Caesar cipher involves shifting each letter by a fixed number of positions in the alphabet, either for encryption or decryption depending on the key. Students are to create a program that encrypts and decrypts messages using the Caesar cipher technique.

Uploaded by

jivanlad22
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/ 5

Network and Information Security (22620)

Practical No. 5: Apply security to file, folder or application using access


permission andverify.

I Practical significance
In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher,
Caesar's code or Caesar shift, is one of the simplest and most widely known encryption
techniques. It is atype of substitution cipher in which each letter in the plaintext is replaced
by a letter some fixed number of positions down the alphabet. For example, with a left shift
of 3, D would be replaced by A, E would become B, and so on. The method is named after
Julius Caesar, who used it in his private correspondence
II Relevant Program Outcome (POs)
PO1 – Basic knowledge
PO2 – Discipline
knowledge
PO3 – Experiments and
practicePO4 – Life-long
learning

III Competency and practical Skills


“Implement caesar cipher program ”
To create a program to implement Caesar cipher for encryption and decryption.

IV Relevant Course Outcome(s)


a. Identify risks related to Computer Security and Information hazard in various situations.
b. Apply user identification and authentication methods.
c. Apply Cryptographic algorithm and protocol to maintain Computer Security.
d. Apply measures to prevent attacks on network using firewall.
e. Maintain secured network and describe Information Security Compliance Standard.

V Practical outcomes
Create program to implement Caesar Cipher.

VI Relevant Affective Domain Related Outcomes


1. Follow precautionary measures
2. Demonstrate working as a leader / a team member
3. Follow ethical practices

Page No : 1
By Prof.R.H.Rathod, Comp.Engg. Deptt., Dr.Panjabrao Deshmukh Polytechnic, Amravati
Network and Information Security (22620)
VII Minimum Theoretical Background

The Caesar Cipher technique is one of the earliest and simplest method of encryption technique.
It’s simply a type of substitution cipher, i.e., each letter of a given text is replaced by a letter
somefixed number of positions down the alphabet. For example with a shift of 1, A would be
replaced by B, B would become C, and so on. The method is apparently named after Julius
Caesar, who apparently used it to communicate with his officials.
Thus to cipher a given text we need an integer value, known as shift which indicates the number
ofposition each letter of the text has been moved down.
The encryption can be represented using modular arithmetic by first transforming the letters into
numbers, according to the scheme, A = 0, B = 1,…, Z = 25. Encryption of a letter by a shift n
can be described mathematically as.
(Encryption Phase with shift n) (Decryption Phase with shift n)

VIII Work situation


1. Faculty must form a group of students.
2. Faculty will demonstrate the use of network cable.
3. Students group will use the tools and piece of Cat6 cables to configure peer-to-
peernetwork.

IX Resources required (Additional)

SN Instrument/Object Specification Quantity Remarks

01 Desktop PC Processor i3/i5 1 / group Yes

02 Software TurboC 1 / group Yes

X Precaution to be followed
a. Handle computer system and peripherals with care
b. Handle cat6 crossover cable carefully
c. Follow safety precautions
d. Disconnect PCs from these cables and shut down properly

XI Procedure
Program For Encryption:
#include<stdio.
h>int main()
{
char str_message[500],

Page No : 2
By Prof.R.H.Rathod, Comp.Engg. Deptt., Dr.Panjabrao Deshmukh Polytechnic, Amravati
Network and Information Security (22620)
ch;int j, key;
printf("Enter a message to encrypt: ");
scanf("%s",str_message);
printf("Enter the key: ");
scanf("%d", &key);
for(j = 0; str_message[j] != '\0';
++j){ch = str_message[j];
if(ch >= 'a' && ch <=
'z'){ch = ch + key;
if(ch > 'z'){
ch = ch - 'z' + 'a' - 1;
}
str_message[j] = ch;
}
else if(ch >= 'A' && ch <=
'Z'){ch = ch + key;
if(ch > 'Z'){
ch = ch - 'Z' + 'A' - 1;
}
str_message[j] = ch;
}
}
printf("Encrypted message: %s", str_message);
getch();
return 0;
}

Output:

Page No : 3
By Prof.R.H.Rathod, Comp.Engg. Deptt., Dr.Panjabrao Deshmukh Polytechnic, Amravati
Network and Information Security (22620)

Program For
Decryption:
#include<stdio.h>
int main()
{
char str_message[500],
ch;int j, key;
printf("Enter a message to decrypt: ");
scanf("%s",str_message);
printf("Enter key: ");
scanf("%d", &key);
for(j = 0; str_message[j] != '\0';
++j){ch = str_message[j];
if(ch >= 'a' && ch <= 'z')
{
ch = ch -
key;if(ch <
'a'){
ch = ch + 'z' - 'a' + 1;
}
str_message[j] = ch;
}
else if(ch >= 'A' && ch <=
'Z'){ch = ch - key;
if(ch < 'A')
{
ch = ch + 'Z' - 'A' + 1;
}
str_message[j] = ch;
}
}
printf("Decrypted message: %s", str_message);
getch();
return 0;

Page No : 4
By Prof.R.H.Rathod, Comp.Engg. Deptt., Dr.Panjabrao Deshmukh Polytechnic, Amravati
Network and Information Security (22620)
}
Output:

XII. Observations
Create encryption key and decryption key for given message.

XIII. Questions
Q1. What is Caesar Cipher technique?
….…………………………………………………………………………………………….
.……………………………………………………………………………………………….

Q2. Explain Caesar Cipher to obtain cipher text.

….…………………………………………………………………………………………….
.……………………………………………………………………………………………….

Q3. Write advantages of Caesar Cipher.

….…………………………………………………………………………………………….
.……………………………………………………………………………………………….

Q4. Write disadvantages of Caesar Cipher


….…………………………………………………………………………………………….
.……………………………………………………………………………………………….

Team Members 1) ……………………………… 2)………………………….………. 3)………..………………………….

4) …………………………………….

Signature of Teacher

Page No : 5
By Prof.R.H.Rathod, Comp.Engg. Deptt., Dr.Panjabrao Deshmukh Polytechnic, Amravati

You might also like