Skip to content

🤫 Automatic multi-lingual frequency attack on Caesar ciphers

Notifications You must be signed in to change notification settings

kybercore/caesars-key

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Caesar's Key Attack 🗝️

This is a simple Caesar's cipher attack in Python using frequency analysis. It is inspired by this Medium article and extended to be multi-lingual.

The underlying logic is that each (Latin-alphabet) language has a slightly different average frequency for every character. The best decoding attempt out of all languages with the highest proximity (expressed in a low float output, the difference) appears to reliably represent the correct language.

Caesar's key identifies the language of the encrypted text as well as the key in one go and decrypts the text.

Right now Caesar's key supports English, German, French, Spanish, Italian, Dutch, Portuguese and Swedish.

Usage

python main.py [text file, e. g. input.txt]

Example output:

[decrypted text]
Best guess: ES (proximity 0.9366393682363263 with key 12)

About

🤫 Automatic multi-lingual frequency attack on Caesar ciphers

Topics

Resources

Stars

Watchers

Forks

Languages