228 http://inventwithpython.com/hacking
Email questions to the author: [email protected]
- if response.strip().upper().startswith('D'):
- return decryptedText
- return None
If affineHacker.py is run (instead of imported as a module) call
the main() function.
- if name == 'main':
- main()
Sample Run of the Affine Cipher Hacker Program
When you press F5 from the file editor to run this program, the output will look like this:
Hacking...
(Press Ctrl-C or Ctrl-D to quit at any time.)
Tried Key 95... (U&'<3dJ^Gjx'-3^MS'Sj0jxuj'G3'%j'<mMMjS'g)
Tried Key 96... (T%&;2cI]Fiw&,2]LR&Ri/iwti&F2&$i&;lLLiR&f)
Tried Key 97... (S$%:1bH\Ehv%+1\KQ%Qh.hvsh%E1%#h%:kKKhQ%e)
...skipped for brevity...
Tried Key 2190... (?^=!-+.32#0=5-3*"="#1#04#=2-= #=!~**#"=')
Tried Key 2191... (` ^BNLOTSDQ^VNTKC^CDRDQUD^SN^AD^B@KKDC^H)
Tried Key 2192... ("A computer would deserve to be called i)
Possible encryption hack:
Key: 2192
Decrypted message: "A computer would deserve to be called intelligent if it
could deceive a human into believing that it was human." -Alan Turing
Enter D for done, or just press Enter to continue hacking:
d
Copying hacked message to clipboard:
"A computer would deserve to be called intelligent if it could deceive a human
into believing that it was human." –Alan Turing
How the Program Works..........................................................................................................................................
affineHacker.py
Affine Cipher Hacker
http://inventwithpython.com/hacking (BSD Licensed)
- import pyperclip, affineCipher, detectEnglish, cryptomath