You are on page 1of 49

Transposition

Transposition Techniques
Techniques
(Class-L7)
(Class-L7)
Lecture Slides By:
Monalisa Panigrahi
Asst. Professor
LPU
Transposition Ciphers
• now consider classical transposition
or permutation ciphers
• these hide the message by
rearranging the letter order without
altering the actual letters used
• can recognise these since have the
same frequency distribution as the
original text
Types of Transposition
Ciphers Techniques
• Rail Fence Technique

• Columnar Transposition Techniques


– Simple Columnar Transposition Techniques
– Simple Columnar Transposition Techniques
with multiple rounds
Rail Fence cipher Technique
• write message letters out diagonally over a
number of rows
• then read off cipher row by row

1. Write down the plain text message as a sequence of diagonals

2. Read the plain text written in Step1 as a sequence of rows.


Example
1. Given Plain text – Hello Everyone
H l o v r o e
e l E e y n

2. Cipher Text :
HlovroeelEeyn
Example:

• Plain text : CAPSTONE PROJECT


Simple Columnar
Transposition Techniques
1. Write the plain text message row
by row in a rectangle of a pre-
defined size
2. Read the message column by column.
It can be any random order such as
2,3,1 etc
3. Thus, The message obtained is the
cipher text message.
Example
• 1. Given Plain text– Hello Everyone

• Consider a Rectangle with four columns.

H e l l
o E v e
r y o n
e
Example
• Decide a random order : 2 4 1 3
• Read the text in the order of these
columns
• Cipher Text : eEylenHorelvo
Simple Columnar
Transposition Techniques
with multiple rounds
• Given Text – Hello Everyone
• After Round 1, Cipher text is
eEylenHorelvo
• Perform Step 1 to 3 as many times as
desired
Example
• Round 2: e E y l
• eEylenHorelvo
e n H o
r e l v
o

• Choose same order of columns : 2 4 1 3


• Read the text in the order of these columns

Cipher Text: EneloveeroyHl


Example
Plain Text : CAPSTONE PROJECT
1. CPTNPOETASOERJC
2. SRAECOJPPTCNETO
3. ETRPTONAPOSJECC
Review Questions
1. Sita meets Ram and says
Rjjy rj ts ymj xfggfym bj bnqq inxhzxx ymj uqfs.
If she is using modified Caesar Cipher,
What does she wants to convey ???

2. What would be the transformation of a message


‘HAPPY BIRTH DAY TO YOU’ using Rail Fence Technique

3. The following message was received by Bob :


hs yis ls. eftstof n^ TyymrieraseMr^ e ho ec^etose Dole^.
If the message is encrypted by using The Simple Columnar
Transposition method, with the key as 24153?
Find the original Plain text ?
Review Questions
4. Consider a scheme involving the replacement of
alphabets as follows:
Original : A B C ………. X Y Z
Changed to : Z Y X ………. C B A

If Sita sends a message HSLDNVGSVNLMVB, What


should Ram get from this ?
Encryption and
Decryption
• As we know the process to
transform plain text to cipher text
or vice versa – encryption and
decryption
Encryption and Decryption… Cont

• In computer communication – sender send the


encrypt message through the network.
• Receiver received the message and decrypt it to
plain text.
• To encrypt and decrypt the message – encryption
and decryption algorithm
• Usage both must be same each other – otherwise
the decryption cannot success
• Others method using key = one time pad in
Vernam Technique
• Algorithm – know to everyone– to made the
message secure – use the key.
Encryption and Decryption… Cont
• Every Encryption and Decryption
process has two aspects :

– Algorithms
– Key (used for encryption and
decryption)
Encryption and Decryption… Cont

• There are 2 cryptography mechanism


– Symmetric key Cryptography = use same
key to encrypt and decrypt the message
– Asymmetric key Cryptography – use
different key in encrypt and decrypt
the message
Symmetric and Asymmetric
Key Cryptography
• Symmetric Key Cryptography and the
key distribution problem
Symmetric Key Cryptography and key distribution
problem… Cont

– Problem in transmission. Create the same problem


– By courier may improve the situation – same problem
happened
– Another option by hand-delivery mechanism
– Others idea – put the envelope in box and locked it –
difficult to receiver to opened it – Another KEY?
– Send key by another way
– No solution completely acceptable – either not fully
proof or not practically possible – called key distribution
problem / key exchange problem
– Same key to encrypt and decrypt – symmetric key
operation
Symmetric Key Cryptography and key distribution
problem… Cont

– Let say A want to send different


message to 2 person B and C. so need 2
different pair of key
Symmetric Key Cryptography and key distribution
problem… Cont

– How about involve more than 5 person?


• 10 pairs of key and locked needed
– So we can write in Mathematic
• Person involve (PI)
– PI * (PI – 1) / 2
• Let say 1000 person involve
– 1000 * (1000 – 1) / 2 = 499,500 lock and key
pairs
– Remember that locked and key pair
must be maintained by somebody
Diffie-Hellman Key Exchange /
Agreement Algorithm

– Introduction

• Solution to the problem of key agreement


or key exchange
• Both parties can agree on a symmetric key –
used in encryption / decryption
• Based on mathematical principle – describe
the step in algorithm, illustrate by example
and discuss mathematic basic
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– Description of the algorithm

– Let say Alice and Bob agree upon a key that


used in encrypt/ decrypt. The step by using
Diffie-Helman algorithm shown in the figure.
• Base on the step involve, actually the keys is similar;
K1=K2=K
Diffie-Hellman Key Exchange / Agreement
Algorithm
1
Alice Alice and Bob agree on two Bob
prime numbers, n and g

2 4
A = g^x mod n B = g^y mod n
3 5
A B
6 7
K1=B^x modn K2=A^y modn

As it turns out, K1=K2=K. Thus


K becomes the shared Symmetric key
between Alice and Bob
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– Example of the algorithm


• Let take small exam to prove the Difie-
Helman Key Exchange. This have been
shown in Fig. 3.2
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– Mathematical Theory behind the algorithm


• 1st lets look at technical description of the
complexity of the algorithm

• What is actually means


– Take a look what Alice does in step 6.
Here the compute
» K1 = Bx mod n
» What is B? from step 4.
» B = gy mod n
» There for, substitute this value of B
in step 6 we have following equation
» K1 = (gy)x mod n = gyx mod n
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– What Bob does in step 7. Here Bob compute;

» K2 = Ay mod n
» What is A? from step 2 we have;
» A = gx mod n
» There for, substitute this value of A in step 7 we have
following equation
» K2 = (gx)y mod n = gxy mod n

– Now basic mathematic say


» Kyx=Kxy

– So we get K1=k2=k. Hence the Proof


– Obviously question, if Alice and Bob can generate key
separately – so can attacker.
– Solution: exchange n,g,A,B; base on x and y that cannot easily
be calculated – mathematically
Why Diffie-Hellman Works ???
Alice Bob

Alice fill
up Bob fills
Another up
one-third Another
one-third
Of the
One-Third of the key(g) is public g Of the
key using g
her key using
secret his
random secret
number Alice sends the Bob sends the random
key to Alice y number
x key to Bob
Alice g
g Bob
Completes Completes
The key The key
By adding By adding
The last x y
The last
Part
Received
y x Part
Both keys are the same because the order of Received
From g g From
Bob Completion (x First or y First) does not matter
Alice
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– Problem with algorithm


• Diffie Helman Key Exchange – not solve all the
problem associated with key exchange
• Can fall pray to the man-in-the-middle attack that
also called bucket brigade attack.
• This happened as follow
– As usual Alice send n and g to Bob, let say n=11 and g=7
(those code is basic in calculate the key K1=K2=K)
– She not realize that the hacker (Tom) listening for
their conversation. Tom copy all the value.
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– Lets say all select random value for x and y as


shown in fig.3.24
– All the three person calculate A and B with x and
y that have been selected. Note that Alice
calculate for A and Bob calculate for B but Tom
calculate both, A and B. this can be look at fig.
3.25

Fig. 3.24

Fig. 3.25
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

– The real Drama:


» Alice send A(e.i: 2) to Bob, Tom
intercept it and send his A (e.i: 9)to
Bob. Bob not realized it.

» Bob send his B (e.i: 8) to Alice, Tom


intercept it and send his B (e.i: 4)
Alice. Alice accept it and not realized
what had happened

» At this juncture, Alice, Bob, and Tom


have a value A and B as shown in 3.27
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont
Diffie-Hellman Key Exchange / Agreement Algorithm…
Cont

Fig. 3.27

» Base the key, those three person generate


the key as shown in 3.28
» Why Tom generate 2 keys?

Fig. 3.28
Asymmetric Key Operation

• Asymmetric Key Operation


– Have 2 keys ; encrypt and decrypt the
message.
– Let say A want to send a message to B, so B
will send K1 to A to be used in encrypting the
message
– B will open / decrypt the message by using K2
– K1 != K2
– K1 everyone know… but not K2; only B knows.
– K1 known as public Key and K2 as private key
Asymmetric Key Operation
Asymmetric Key Operation

– What if B want to received a message from C;


C may use the same key (K1) to encrypt the
message and B can use K2 (same as used to
decrypt message A)
– Only a pair of key is needed to execute
cryptography process (if B want to receive
from 1000 person)
– But if they want to communicate with each
other they will need 1000 lock, 1000 K1, 1000
K2 – not as symmetric (499, 500)
Steganography
• Technique that hiding the message inside
other message
• Historically, the sender use invisible ink,
tiny pin puncher on specific character, etc
• Of late – hiding behind the picture

Fig. 3.30
Key Range and Key Size
• The cryptanalyst is armed with the
following information
– The encryption/ decryption algorithm
– The encrypted message
– Knowledge about the key size
• Keys – challenge for the attackers
• Attackers can develop programming to
solve the keys – depend to size of key
Key Range and Key Size… Cont
Key Range and Key Size… Cont

• How attackers determine either the


message that he/she decrypt is the
plain text or the right keys?
• How to prevent?
– Size of the keys (40, 56, 120 etc)
– In bit
– Bigger the key size; long time to crack
Key Range and Key Size… Cont
Key Range and Key Size… Cont

– Can also represent the possible values in the


key range using hexadecimal
– Complexity to the attackers
– The keys size chasing by the technology
• today- 56 bit not safe;
• Tomorrow – 128bit may not safe
• Another day – 256-
– But impossible to 512 bit; why?
• Suppose that every atom in the universe is actually a
computer
• In the world – 2300; if each computer can check 2300
keys in one second (which cannot happen)
• 2162 millennia to search 1% of 512 bit key;
Key Range and Key Size… Cont
Possible Types of
Attacks
• 3 possibility Attacks can be occurs
– Cipher Text only Attack
• The attacker doesn’t know about the plain text. Has
some and all the cipher text. Guess the meaning of
the message
– Know Plain Text Attack
• Know some pair of plain text and corresponding the
cipher text – tries to find other pairs of plain text
– Chosen Plain Text Attack
• Chosen the plain text block – try to look for
encryption of the same in cipher text
Question
• Alice and Bob want to establish a
secret key using the Diffie-Hellman
Key Exchange protocol.
• Assume n=11, g=5, x=2, y=3.
• Find out the values of A, B and the
secret Key (K1, K2)

You might also like