Skip to content

Instantly share code, notes, and snippets.

@ildus
Created February 25, 2013 20:51
Show Gist options
  • Save ildus/5033169 to your computer and use it in GitHub Desktop.
Save ildus/5033169 to your computer and use it in GitHub Desktop.
#coding: utf-8
LAT = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
CODE = """
FUBSWRJUDSKLF NHBV DUH DQDORJRXV WR WKH KRXVH DQG FDU NHBV ZH FDUUB LQ RXU
GDLOB OLYHV DQG VHUYH D VLPLODU SXUSRVH
"""
#k == 3
#CRYPTOGRAPHIC KEYS ARE ANALOGOUS TO THE HOUSE AND CAR KEYS WE CARRY IN OUR DAILY LIVES AND SERVE A SIMILAR PURPOSE
for k in xrange(1, 100):
result = ''
for c in CODE:
if c in LAT:
code = LAT.index(c)
x = (code - k + len(LAT)) % len(LAT)
result += LAT[x]
else:
result += ' '
print k, " ", result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment