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

Tutorial on Cybersecurity basics

The document provides solutions for various encryption and decryption techniques including Atbash, Caesar, and Playfair ciphers. It details the steps for encrypting and decrypting specific plaintexts and ciphertexts, along with frequency analysis for substitution ciphers. Additionally, it outlines the Playfair cipher encryption algorithm and rules for pairing letters and handling unique cases.

Uploaded by

Sudhanshu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Tutorial on Cybersecurity basics

The document provides solutions for various encryption and decryption techniques including Atbash, Caesar, and Playfair ciphers. It details the steps for encrypting and decrypting specific plaintexts and ciphertexts, along with frequency analysis for substitution ciphers. Additionally, it outlines the Playfair cipher encryption algorithm and rules for pairing letters and handling unique cases.

Uploaded by

Sudhanshu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

SOLUTIONS To TUTORIAL 1

Implementation of Substitution Techniques

1. Encrypt the plaintext "HELLO WORLD" using a Mono-alphabetic Atbash Cipher.

Answer:
Atbash cipher: A -> Z, B -> Y, C -> X, ..., Z -> A
Encrypted Text: "SVOOL DLIOW"

2. Encrypt the message "SECURE" using a Caesar cipher with a shift of 5.

Answer:
Encrypted Text: "XJHWZJ"

3. Decrypt the ciphertext "KHOOR" encrypted using a Caesar cipher with a shift of 3.

Answer:
Decrypted Text: "HELLO"

4. Construct a Playfair matrix with the key cryptography. Make a reasonable assumption
about how to treat redundant letters in the key.

Answer:

C R Y P T
O G A H B
D E F I K
L M N Q S
U V W X Z

5. Encrypt the plaintext “INSTRUMENTS” using Playfair Matrix with key as


“MONARCHY”.

Answer: (Attached at end)

6. You intercept a ciphertext: "ZEBBW XYCQB ZEBBW". A frequency analysis reveals


the following letter frequencies:

Z: 20%, E: 15%, B: 15%, W: 10%, X: 10%, Y: 10%, C: 10%, Q: 10%

Assume a Monoalphabetic substitution and suggest possible plaintext for the ciphertext.

1
Answer:

To decrypt the ciphertext "ZEBBW XYCQB ZEBBW" using frequency analysis, we assume that
the frequency of letters in the ciphertext corresponds to the relative frequency of letters in
English. Here’s the step-by-step process:

1. Analyze the Letter Frequencies

The frequencies in the ciphertext are:

 Z: 20%, E: 15%, B: 15%, W: 10%, X: 10%, Y: 10%, C: 10%, Q: 10%.

2. Map Ciphertext Frequencies to English Frequencies

The most frequent letter in English is E. Since Z is the most frequent letter in the ciphertext
(20%), we map Z to E.

For the second most frequent letters (E and B, each 15%), we compare their context in the
ciphertext and map them to commonly used letters in English, such as T or A.

3. Substitution Hypothesis

Let’s hypothesize mappings based on frequency and context:

 Z→E
 E→T
 B→A
 W→R
 X→H
 Y→I
 C→S
 Q→O

4. Decrypt the Ciphertext

Using the mapping, the ciphertext "ZEBBW XYCQB ZEBBW" decrypts as:
"EARAR HISOS EARAR".

5. Refine the Plaintext

"EARAR HISOS EARAR" can be refined to make sense in English. Based on patterns, this
could represent:
"EAGER HOUSE EAGER"
(assuming slight adjustments for readability).

2
7. Assuming Vigenère cipher, show how the text ‘WE ARE DISCOVERED SAVE
YOURSELF’ will be encrypted. Consider the key to be “DECEPTIVE”.
Answer:

Answer to 5:

3
The Playfair Cipher Encryption Algorithm:
The Algorithm consists of 2 steps:
Generate the key Square(5×5):

 The key square is a 5×5 grid of alphabets that acts as the key
for encrypting the plaintext. Each of the 25 alphabets must be
unique and one letter of the alphabet (usually J) is omitted
from the table (as the table can hold only 25 alphabets). If the
plaintext contains J, then it is replaced by I.

 The initial alphabets in the key square are the unique


alphabets of the key in the order in which they appear followed
by the remaining letters of the alphabet in order.

2. Algorithm to encrypt the plain text: The plaintext is split into


pairs of two letters (digraphs). If there is an odd number of
letters, a Z is added to the last letter.
For example:

PlainText: "instruments"
After Split: 'in' 'st' 'ru' 'me' 'nt' 'sz'

1. Pair cannot be made with same letter. Break the letter in single
and add a bogus letter to the previous letter.
Plain Text: “hello”
After Split: ‘he’ ‘lx’ ‘lo’
Here ‘x’ is the bogus letter.

2. If the letter is standing alone in the process of pairing, then add


an extra bogus letter with the alone letter
Plain Text: “helloe”
AfterSplit: ‘he’ ‘lx’ ‘lo’ ‘ez’
Here ‘z’ is the bogus letter.

Rules for Encryption:


 If both the letters are in the same column: Take the letter
below each one (going back to the top if at the bottom).
4
For example:

Diagraph: "me"
Encrypted Text: cl
Encryption:
m -> c
e -> l

 If both the letters are in the same row: Take the letter to the
right of each one (going back to the leftmost if at the rightmost
position).
For example:

Diagraph: "st"
Encrypted Text: tl
Encryption:
s -> t
t -> l

 If neither of the above rules is true: Form a rectangle with


the two letters and take the letters on the horizontal opposite
corner of the rectangle.
For example:
Diagraph: "nt"
Encrypted Text: rq
Encryption:

5
n -> r
t -> q

For example:
Plain Text: "instrumentsz"
Encrypted Text: gatlmzclrqtx
Encryption:
i -> g
n -> a
s -> t
t -> l
r -> m
u -> z
m -> c
e -> l
n -> r
t -> q
s -> t
z -> x

6
7

You might also like