Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
185 views

Network Tutorial 1 Submit2

The document describes 3 types of cipher techniques: [1] Caesar cipher which involves shifting the alphabet by a fixed number of places, [2] Mono-alphabetic cipher which maps each letter to a random letter, and [3] Playfair cipher which encrypts letters in pairs using a 5x5 key square. Examples of encrypting messages are given for each cipher along with explanations of their encryption methods.

Uploaded by

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

Network Tutorial 1 Submit2

The document describes 3 types of cipher techniques: [1] Caesar cipher which involves shifting the alphabet by a fixed number of places, [2] Mono-alphabetic cipher which maps each letter to a random letter, and [3] Playfair cipher which encrypts letters in pairs using a 5x5 key square. Examples of encrypting messages are given for each cipher along with explanations of their encryption methods.

Uploaded by

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

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 another letter. The following
example shows the replacement of each letter by 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: a b c d e f g h i j k l m n o p q r s t u v w x y z

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

Encrypt the following plain text using Caeser Cipher

1. the car key is located under the door matt

Ans : WKH FDU NHV LV ORFDWHG XOGHH WKH GRRU PDWW

2. we will meet tomorrow at Alamanda Putrajaya

Ans: ZH ZLOO PHHW WRPRUURZ DW DOOPDKGD SXWUDMDBD

3. the treasure is located under the coconut tree

Ans : WKH WUHDVXUH LV ORFDWHG XOGHU WKH FRFROXW WUHH


2. Mono-alphabetic Cipher

Rather than just shifting the alphabet like in Caesar cipher, we can shuffle (jumble) the letters
arbitrarily. Each plaintext letter maps to a different random cipher text letter. Hence, key is 26
letters long.

plain: a b c d e f g h I j k l m n o p q r s t u v w x y z

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

Encrypt the following plain text again using Mono-alphabetic Cipher

1. the car key is located under the door matt

Ans : UJF VDY EFZ WA SHVDUFQ OXQFY UJF QHHY CDUU

2. we will meet tomorrow at Alamanda Putrajaya

Ans : RF RWSS CFFU UHCHYYHR DU DSDCDXGD TOUYDPDZD

3. the treasure is located under the coconut tree

Ans : UJF UYFDAOYF WA SHVDUFQ OXQFY UJF VHVHXOU UYFF


3. Playfair Cipher

The 'key' for a playfair cipher is generally a word, for the sake of example we will choose
'monarchy'. This is then used to generate a 'key square', e.g.

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

Any sequence of 25 letters can be used as a key, so long as all letters are in it and there are no
repeats. Note that there is no 'j', it is combined with 'i'. We now apply the encryption rules to
encrypt the plaintext.

1. Remove any punctuation or characters that are not present in the key square (this may
mean spelling out numbers, punctuation etc.).
2. Identify any double letters in the plaintext and replace the second occurrence with an 'x'
e.g. 'hammer' -> 'hamxer'.
3. If the plaintext has an odd number of characters, append an 'x' to the end to make it
even.
4. Break the plaintext into pairs of letters, e.g. 'hamxer' -> 'ha mx er'
5. The algorithm now works on each of the letter pairs.
6. Locate the letters in the key square, (the examples given are using the key square
above)

If the letters are in different rows and columns, replace the pair with the letters on the same row
respectively but at the other pair of corners of the rectangle defined by the original pair. The
order is important – the first encrypted letter of the pair is the one that lies on the same row as
the first plaintext letter. 'ha' -> 'bo', 'es' -> 'il'

1. If the letters appear on the same row of the table, replace them with the letters to their
immediate right respectively (wrapping around to the left side of the row if a letter in the
original pair was on the right side of the row). 'ma' -> 'or', 'lp' -> 'pq'
2. If the letters appear on the same column of the table, replace them with the letters
immediately below respectively (wrapping around to the top side of the column if a letter
in the original pair was on the bottom side of the column). 'rk' -> 'dt', 'pv' -> 'vo'
Example of playfair encryption using the same key square

plaintext: wearediscoveredsaveyourselfx

ciphertext: ugrmkcsxhmufmkbtoxgcmvatluiv

Encrypt the following using Playfair Cipher (using the same key square) :

1. the car key is located under the door matt

: TH EC ARKE YI SL OC AT ED UN DE RT HE DO OR MA TT

Ans : PD LE RM EF GB TP WH SR KC XM MK DZ CF HR NM OR RR

2. we will meet tomorrow at Alamanda Putrajaya

: WE WI LX LM EX ET TO MO RX RO WA TA LA MA ND AP UT RA JA YA

Ans : GU XG SU UC IU KL PR NO AZ MO NX SR SM OR RY OS ZL MR SB BN

3. the treasure is located under the coconut tree

: TH ET RE AS UR EI SL OC AT ED UN DE RT HE CO CO NU TX TR EX EX

Ans : PD KL MK BX ZM FK TP MH RS KC WM CK TZ CF HM HM MW SZ ZD IU IU

You might also like