Skip to content

Instantly share code, notes, and snippets.

@DoubleYouEl
DoubleYouEl / spam_decode.py
Last active November 2, 2024 07:24 — forked from lkraider/spam_decode.py
X-OVH-SPAMCAUSE decoder
def decode(msg):
text = ""
for i in range(0, len(msg), 2):
text += unrot(msg[i: i + 2], i // 2) # add position as extra parameter
return text
def unrot(pair, pos, key=ord('x')):
if pos % 2 == 0: # "even" position => 2nd char is offset
pair = pair[1] + pair[0] # swap letters in pair