Hacking Secret Ciphers with Python

(Ann) #1

228 http://inventwithpython.com/hacking


Email questions to the author: [email protected]



  1. if response.strip().upper().startswith('D'):

  2. return decryptedText

  3. return None






  4. If affineHacker.py is run (instead of imported as a module) call




  5. the main() function.



  6. if name == 'main':

  7. 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



  1. Affine Cipher Hacker




  2. http://inventwithpython.com/hacking (BSD Licensed)





  3. import pyperclip, affineCipher, detectEnglish, cryptomath



Free download pdf