PDA

View Full Version : New Forum Game: Crack My Encryption!


Sir Penguin
09-10-2003, 08:19:04
Here's a classic decryption challenge:

I've encrypted a short string using a trivial algorithm of my own construction. The string consists of one word: a 5 letter noun. Post that word, and win a prize*!

To make this easier, I will provide the encrypted string, the password used, and the code used to encrypt.

The encrypted string:
mb~}~`bwc

The password:
twat

The encryption code:def encrypt(s,p):
ords = []
newstr = ""
s += p
for c in p:
ords.append(ord(c))
mask = sum(ords) / len(ords) - min(ords)
for i in range(0,len(s)):
off = i
if mask + i > 255:
off -= 255 * ( (mask+i) / 255)
newstr += chr( ord(s[i]) ^ (mask+off) )
return newstrNote that the function takes two arguments: the first is the string to be encrypted (the one you have to identify), and the second is the password. The ord(c) function returns the ASCII value of the character stored in variable c. The chr(i) function does the opposite. The binary ^ operator is a bitwise xor.

* Prize is a free** trip to Venom's house and a free** baseball bat
** free for me, at least

SP

MDA
09-10-2003, 12:51:39
canuck

Qaj the Fuzzy Love Worm
09-10-2003, 16:01:16
asshat

No, wait, that's six characters.

Venom
09-10-2003, 19:00:35
the word is Venom.

Qaj the Fuzzy Love Worm
09-10-2003, 19:31:17
It's can't be, there's a }~ in there.

MDA
09-10-2003, 20:10:50
Bird is the word!

zmama
09-10-2003, 20:14:52
moron

Sean
09-10-2003, 20:17:23
Traceback (most recent call last):
File "<pyshell#2>", line 1, in ?
encrypt('twat', 'moron')
File "<pyshell#1>", line 7, in encrypt
mask = sum(ords) / len(ords) - min(ords)
NameError: global name 'sum' is not defined

Darkstar
09-10-2003, 20:18:45
9 characters... if we end up with the same number of characters that went in.

Without bothering to create a decrypter and derive the answer, I think the original string is "urgaytwat".

Sean
09-10-2003, 20:20:16
I've encrypted a short string using a trivial algorithm of my own construction. The string consists of one word: a 5 letter noun. Post that word, and win a prize*!

Darkstar
09-10-2003, 20:50:58
100-0

Sean
09-10-2003, 21:05:12
As if. That was a response to MDA.

Sir Penguin
09-10-2003, 21:27:37
Originally posted by Sean
Traceback (most recent call last):
File "<pyshell#2>", line 1, in ?
encrypt('twat', 'moron')
File "<pyshell#1>", line 7, in encrypt
mask = sum(ords) / len(ords) - min(ords)
NameError: global name 'sum' is not defined You need Python 2.3. Also, you've got the arguments to the encrypt() function backwards.

Another hint: I tried a whole bunch of common forum phrases, but they all ended up with control characters in the encrypted string. The word I encrypted isn't a forum thing.

SP

Darkstar
09-10-2003, 22:12:16
Sean, it's still a 100-0. Just MDA's to claim. ;)

Sean
09-10-2003, 22:32:40
Only if he meant it.

Seriously, it was a 100-0. You bastard.

Originally posted by Sir Penguin
You need Python 2.3. Also, you've got the arguments to the encrypt() function backwards.
I got it into my head that s was shorthand for seed. Just use proper variable names, willya?

Sir Penguin
09-10-2003, 23:30:30
It's a security measure. :coolgrin:

SP

Qaj the Fuzzy Love Worm
10-10-2003, 00:16:36
Boobs.

Sorry, Freudian slip. I meant penis.

MDA
10-10-2003, 16:02:06
Originally posted by Darkstar
Sean, it's still a 100-0. Just MDA's to claim. ;)

It wasn't an attempt, but I was aware of the five letter thing - that's why my first guess was "canuck".

"Bird is the word" is song lyrics - and if you knew that and were setting up a really complex 100-0, you win. You win nothing, but you win. :)

Aredhran
13-10-2003, 09:30:41
Originally posted by MDA
It wasn't an attempt, but I was aware of the five letter thing - that's why my first guess was "canuck".

Maybe you were aware, but for sure you can't count

Qaj the Fuzzy Love Worm
13-10-2003, 17:06:10
Or, maybe he was betting that it was the Canadian who couldn't :)

MDA
14-10-2003, 14:29:45
:lol:

I've been on a dumber-than-usual streak for weeks now.

Darkstar
14-10-2003, 18:10:06
Own Goal! No scoring 100-0 TWICE of the same set up! That's just unsporting.

He's counting in computer...

C = 0
A = 1
N = 2
U = 3
C = 4
K = 5

That's 5.

Sir Penguin
14-10-2003, 22:39:23
OK, that's really pushing it. :)

SP

MDA
15-10-2003, 16:26:44
Darkstar, you're giving me WAY too much credit, but the effort is appreciated! :beer: