Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Autokey Cipher

Presented By
Ali (2020-SE-33)
Hashar Ahmed (2020-SE-12)
History
• The Autokey Cipher is almost identical to the Vigenère Cipher – only it’s more secure.
• It was first invented by Girolamo Cardano and was made more secure by Vigenère(The Vigenère
cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on
the letters of a keyword )
• It is closely related to the Vigenère cipher but uses a different method of generating the key.
What is Autokey Cipher

• An autokey cipher (also known as the autoclave cipher) is a cipher that incorporates the
message (the plaintext) into the key.
• Autokey Cipher is a polyalphabetic substitution cipher.
• There are two forms of autokey ciphers.
1. Key Autokey Cipher
2. Text Autokey Cipher
Tabula Recta

• Fundamental tool in classical cryptography.

• Square table containing alphabet rows.

• Each row is shifted by one position to the left.

• Used for encryption/decryption.

• Locate intersections for ciphertext/plaintext.

• Key cycles through letters as needed.


Key Autokey Cipher
• A key-autokey cipher uses previous members of the keystream to determine the next element in the
keystream.
• Example:
• Let's encrypt the plaintext "HELLO" with the key "KEY".
• Plaintext: H E L L O
• Key: K E Y H E
• Ciphertext: T I C V P
Here, the first letter of the key "K" is used to encrypt "H", then "E" encrypts "E", "Y" encrypts "L", and
so on. When the ciphertext "T" is generated, it's added to the key sequence, and "T" becomes part of the
key for encrypting the next character.
Text Autokey Cipher
• A text-autokey uses the previous message text to determine the next element in the keystream.
• Example:
• Let's encrypt the plaintext "HELLO" using the initial key "SECRET".
• Plaintext: H E L L O
• Key: S H E L L
• Ciphertext: V O P Z Y
In this example, "S" encrypts "H", "H" encrypts "E", "E" encrypts "L", and so on. The ciphertext
generated ("V") then becomes part of the key sequence. Subsequently, "V" encrypts "L", "O" encrypts
"L", and so forth.
Example
• Message: Meet at the fountain

• Keyword: KILT

• Plaintext: MEETATTHEFOUNTAIN

• Key: KILTMEETATTHEFOUN

• Ciphertext: WMPMMXXAEYHBRYOCA
Mathematically
Key Stream
Example
• Plaintext = HELLO
• Autokey = N
• Key will be: N H E L L

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
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Encryption
• Plain Text(P) : H E L L O
7 4 11 11 14
• Corresponding Number:
N H E L L
• Key(K) :
13 7 4 11 11 Ci = ( Pi + Ki ) Mod 26
• Corresponding Number:
20 11 15 22 25
• Applying the formula:
U L P W Z

• Hence Ciphertext is: ULPWZ


Decryption

• Cipher Text(C) : U L P W Z
• Corresponding Number: 20 11 15 22 25

• Key(K) : N H E L L Pi = ( Ci - Ki ) Mod 26
• Corresponding Number: 13 7 4 11 11

• Applying the formula: 7 4 11 11 14


H E L L O

• Hence Plaintext is: HELLO


References

• https://www.geeksforgeeks.org/autokey-cipher-symmetric-ciphers
• https://youtu.be/-UgLXx-RIKE?si=UQBWNHgEsoGQeyRQ
• https://youtu.be/JsUHsrXl2cw?si=_Etm2POHz7MNyjTS

You might also like