Skip to content

Ever needed to find an enigma setting encrypting a given plaintext to a certain ciphertext?

License

Notifications You must be signed in to change notification settings

buknon/enigma-bruteforce

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enigma-bruteforce

This small script tries to find a enigma setting encrypting known plaintext into known ciphertext.

Brian Neal's Py-Enigma library is used to simulate the enigma. All possible combinations are bruteforced. Note that is unlikely to find a working combination using this strategy if the plaintext and ciphertext are somewhat longer than five characters each.

Example:

$ python3 brute-force.py --plaintext=GITHUB --ciphertext=PYJAMA

This outputs (after a while of searching):

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Solution found! Encrypt GITHUB to PYJAMA
{'ref': 'B', 'plug': 'AB CD EF GL HJ IN KO MP QT RS ', 'rotor': ('I', 'II', 'III'), 'ring': [0, 0, 0], 'display': 'HLR'}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Dependencies

Py-Enigma

About

Ever needed to find an enigma setting encrypting a given plaintext to a certain ciphertext?

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%