From c3b0fa04a663fe233765b83d3be41a42aa08c25d Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 3 May 2021 08:21:10 +0100 Subject: Initial import for public release --- tools/encrypt.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tools/encrypt.py (limited to 'tools/encrypt.py') diff --git a/tools/encrypt.py b/tools/encrypt.py new file mode 100644 index 0000000..6e03336 --- /dev/null +++ b/tools/encrypt.py @@ -0,0 +1,25 @@ + +def enc(key, text): + p = 0x59 + r = [] + for c in text: + new = ((ord(c) ^ p) ^ key) & 0xff + r.append(new) + p = new + return r + +def dec(key, text): + p = 0x59 + r = [] + for c in text: + new = ((c ^ key) ^ p) & 0xff + r.append(new) + p = c + return r + +res = enc(0xfe, "THE WAR IS OVER AND\nWE PREVAILED.\n\nFOR NOW...\n\nYOU ARE A LEGEND!\n\nTHANKS FOR PLAYING\nTHE GAME.\0") +print ", ".join("0x%02x" % r for r in res) + +res = dec(0xfe, res) +print "".join(chr(r) for r in res) + -- cgit v1.2.3