Rot Algorithm in Python
A while ago I wanted to send a bunch of emails to building companies in order to get some quotes and/or information. Unfortunately, the website in question (pagesdor.be) doesn’t provide emails in clear text to allow me copy/paste. Instead it uses a Rotating cypher algorithm (I guess it must be simple enough to be able to be decrypted by a browser).
After a couple of emails, where the process of sending through the website costed me some time I figured that it would be easier to see and implement the algorithm myself. The result is a pretty simple hack, in python:
ref = ord('r')
clear = ord('e')
a_ord = ord('a')
outb = ""
for c in encoded:
oc = ord(c)
# Only decrypt the alpha.
if oc in range(ord('a'), ord('z') + 1):
rc = chr((ord(c) - a_ord + clear - ref) % 26 + a_ord)
rc = c
outb += rc
A little experiment: If you find this post and ad below useful, please check the ad out :-)