ts = [
('this will probably not be fun', 'tiks zjop twrggfrf uwz kl pcx'),
('hopefully you will find satisfaction at least', 'hprehxmoc ctx cmrs mqtl zjdqcqjnfsaa nh ztnhj'),
('really this is very tedious', 'rfclnb wlkw lx zkyd bklrvdc')
]
0,1,2, 0,2,3, 1,3,4, 2,4,5, 3,5,6, 4,6,7, 5,7,8, 6,8,9, 7,9,10
def gen():
i = 0
while 1:
if i < 3:
yield [0, 1, 2][i]
else:
q, r = divmod(i, 3)
yield q - 1 + [0, 2, 3][r]
i += 1
def decrypt(msg):
g = gen()
n = len(msg)
ans = []
for i in range(n):
k = next(g)
if msg[i] == ' ':
ans.append(' ')
else:
ans.append(chr((ord(msg[i]) - 97 + k) % 26 + 97))
return ''.join(ans)
for a, b in ts:
print(decrypt(a), "====", b)
To embed this program on your website, copy the following code and paste it into your website's HTML: