Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Practical Lesson 3

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Laboratory Work 3.

Substitution cipher: Caesar cipher, monoalphabetic method

Goal of the laboratory work is to obtain how to chipper a text using Caesar
algortihm. To learn how to use the Monoalphabetic method of encryption.
Tasks to perform. Use the pen and paper to do encoding and decoding using
the algorithm.
1.1 Caesar cipher
The earliest known, and the simplest, use of a substitution cipher was by
Julius Caesar. The Caesar cipher involves replacing each letter of the alphabet with
the letter standing three places further down the alphabet.
For example,
plain: meet me after the toga party
cipher: PHHW PH DIWHU WKH WRJD SDUWB
Note that the alphabet is wrapped around, so that the letter following Z is A.
We can define the transformation by listing all possibilities, as follows:
plain: abcdefghijklmnopqrstuvwxyz
cipher: DEFGHIJKLMNOPQRSTUVWXYZABC
Then the algorithm can be expressed as follows.
For each plaintext letter p, substitute the ciphertext letter C:
C = E(3,p) = (p + 3) mod26
A shift may be of any amount, so that the general Caesar algorithm is
C = E(k,p) = (p + k) mod26
where k takes on a value in the range 1 to 25. The decryption algorithm is
simply
p = D(k,C) = (C - k)mod26
If it is known that a given ciphertext is a Caesar cipher, then a brute-force
cryptanalysis is easily performed: simply try all the 25 possible keys.
1.2 Monoalphabetic method
The Caesar cipher is one of the earliest known and simplest ciphers. It is a
type of substitution cipher in which each letter in the plaintext is 'shifted' a certain
number of places 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 named after Julius Caesar, who apparently used it to
communicate with his generals. To pass an encrypted message from one person to
another, it is first necessary that both parties have the 'key' for the cipher, so that
the sender may encrypt it and the receiver may decrypt it. For the caesar cipher, the
key is the number of characters to shift the cipher alphabet.
Here is a quick example of the encryption and decryption steps involved with
the caesar cipher. The text we will encrypt is 'defend the east wall of the castle',
with a shift (key) of 1.
plaintext: defend the east wall of the castle
ciphertext: efgfoe uif fbtu xbmm pg uif dbtumf
It is easy to see how each character in the plaintext is shifted up the alphabet.
Decryption is just as easy, by using an offset of -1.
plain: abcdefghijklmnopqrstuvwxyz
cipher: bcdefghijklmnopqrstuvwxyza
Obviously, if a different key is used, the cipher alphabet will be shifted a
different amount

Laboratory work 3
Aim of the work: This lab work is aimed at students studying cryptographic
methods in order to protect information from unauthorized using Caesar cipher.
In this section and the next, we examine a sampling of what might be called
classical encryption techniques. A study of these techniques enables us to illustrate
the basic approaches to symmetric encryption used today and the types of
cryptanalytic attacks that must be anticipated.
The two basic building blocks of all encryption techniques are substitution
and transposition. We examine these in the next two sections. Finally, we discuss a
system that combines both substitution and transposition.
A substitution technique is one in which the letters of plaintext are replaced
by other letters or by numbers or symbols. If the plaintext is viewed as a sequence
of bits, then substitution involves replacing plaintext bit patterns with cipher text
bit patterns.

Task 1 (Caeser Cipher)


Encrypt the message “Live as if you were to die tomorrow. Learn as if you
were to live forever”. Key is 3
Task 2 (Cryptoanalysis)
Decrypt the following sentence “L kdyh qhyhu ohw pb vfkrrolqj lqwhuihuh
zlwk pb hgxfdwlrq.”. Key is 3
Task 3 (Encryption)
Using the Vigenere cipher (keyword World), encode the words: RULES,
INFORMATION;

CONTROL QUESTIONS
1. What the Caesar cipher involves?
2. What is a substitution technique?
3. Using which method of cryptanalysis we can crack the Caesar cipher?
4. To which category of ciphering techniques we can refer the Caesar
cipher?
5. How the decryption algorithm of Caesar cipher is executed?

You might also like