Autokey Cipher

1 minute read

Autokey Cipher Using Python

What is the Autokey Cipher?

It is one of the encryption techniques.
It is a type of polyalphabetic substitution cipher where each character in the plain text is replaced by another character based on the key entered.

Who it works?

For example, the key is alphabet( categorical not numeric), So if the entered key is “mo” and the plain text is “hussein” thenwe must complete by the plain text the key until it matches with the length of the plain text. In our example the key must be “mohusse” and the message is “hussein”. We start to encrypt the message. first we get the ascii for every charchter on the plain text and the key as well then strat to add the to numbers then get The letter corresponding to this number :-

For More Information About Autokey Cipher Autokey Cipher

What do you find in this script?

in this script you can :-
1- Encrypt a message
3- Decrypt an encrypted message

Python Code



Screenshots From Run

How to run this script?

  • Install python

    Download the latest version of python python

  • install termcolor

    pip install termcolor

Whole Code On GitHub


Thanks ☺♥