OT: Cryptography puzzle

T

Timo Virkkala

I was looking through my old emails, and ran across this in a signature:

"""
-----------------------> <---------------------------
When cryptography becomes illegal, jkdf ertjgdd wer k opogl ssfd!
"""

Curious as I was, I wanted to decrypt the end. At first I thought that it
was ROT-13, and tried that. Nope. Then I saw the lone "k" in the middle, and
thought that it must be "a", so I tried ROT-16. Wrong again. I also tried
all other rotations, from 1 to 26, to no avail. Does anyone have any ideas
what to try next?

I also included the arrows, which began the signature, since I thought they
might be significant in some way...
 
A

A.M. Kuchling

When cryptography becomes illegal, jkdf ertjgdd wer k opogl ssfd!

I suspect the letters are simply random. The usual way to complete the
sentence would be "only outlaws will have cryptography", but that doesn't
match the word lengths.

If you want to try decrypting this anyway, on the off chance it does contain
a sentence, note that the 'k' is probably 'a' ('I' seems unlikely) and the
doubled 'dd' letters are probably 'ss' or 'll'.

--amk
 
C

Christian Gudrian

A.M. Kuchling said:
and the
doubled 'dd' letters are probably 'ss' or 'll'.

And what about the 'ss' in 'ssfd'? I don't know many languages that allow
words to start with two identical letters. So either the encryption is a
little more advanced than to just replace characters -- or it's a Scottish
text. ;)

Christian
 
R

Richard Brodie

A.M. Kuchling said:
I suspect the letters are simply random. The usual way to complete the
sentence would be "only outlaws will have cryptography", but that doesn't
match the word lengths.

There is also a lot of keyboard locality: adjacent letters, nothing from the
bottom row, etc.
 
T

Timo Virkkala

A.M. Kuchling said:
I suspect the letters are simply random. The usual way to complete the
sentence would be "only outlaws will have cryptography", but that doesn't
match the word lengths.

Hm. I wonder if it might be some form of rotation, where the space is one
rotating character too.. Probably not. It might be just random.
 
D

David Fraser

Christian said:
And what about the 'ss' in 'ssfd'? I don't know many languages that allow
words to start with two identical letters. So either the encryption is a
little more advanced than to just replace characters -- or it's a Scottish
text. ;)

How eerie :)

import sys
for line in sys.stdin:
if len(line) > 2 and line[0] == line[1]:
sys.stdout.write(line)

on standard English dictionary:

eel
eelgrass
eels
eerie
eerily
ooze
oozed

And say, Afrikaans, has a few more:

[root@scir Python]# ./dd.py < af/wordlist.iso-8859-1 | wc -l
3770
 
C

Christos TZOTZIOY Georgiou

There is also a lot of keyboard locality: adjacent letters, nothing from the
bottom row, etc.

Yes, that is the most obvious hint: it's the author's cat walking on the
keyboard and wailing after the PSU killed the ori
 
G

Greg Ewing

Christian said:
And what about the 'ss' in 'ssfd'? I don't know many languages that allow
words to start with two identical letters.

Obviously it's "my hovercraft is full of eels" with
several spelling mistakes.
 
D

David Fraser

Greg said:
Obviously it's "my hovercraft is full of eels" with
several spelling mistakes.

The attached program shows that there is no one-to-one mapping of
characters that will result in this string matching words from
/usr/share/dict/words (at least on my machine)

Could be faster/neater/more elegant but there you go

David

#!/usr/bin/env python

def templatematches(a, b):
aseen = {}
bseen = {}
for n, c in enumerate(a):
d = b[n]
if c in aseen:
if not d == b[aseen[c]]:
return False
else:
if d in bseen:
return False
aseen[c] = n
bseen[d] = n
return True

def makemapping(a, b, mappedsofar):
mapping = mappedsofar.copy()
for n, c in enumerate(a):
if c in mapping:
if mapping[c] != b[n]:
return None
else:
mapping[c] = b[n]
return mapping

def recurseoptions(matchwords, alloptions, mappedletters={}):
cryptword = matchwords[0]
options = alloptions[0]
mappingsfound = []
for plainword in options:
mapping = makemapping(cryptword, plainword, mappedletters)
if mapping is not None:
if len(matchwords) > 1:
pmappings = recurseoptions(matchwords[1:], alloptions[1:], mapping)
else:
pmappings = [mapping]
if pmappings is not None:
mappingsfound.extend(pmappings)
if mappingsfound:
return mappingsfound
else:
return None

if __name__ == "__main__":
import sys
teststring = "jkdf ertjgdd wer k opogl ssfd"
testwords = teststring.split()
testwordlens = {}
for word in testwords:
testwordlens[len(word)] = True
dictwords = [line.strip().lower() for line in open(sys.argv[1], 'r').readlines()]
dictwords.append('a')
dictwords.append('i')
dictwordlens = dict([(wordlen, filter(lambda word: len(word) == wordlen, dictwords)) for wordlen in testwordlens])
possiblewords = {}
for wordnum, cryptword in enumerate(testwords):
possiblewords[wordnum] = []
for plainword in dictwordlens[len(cryptword)]:
if templatematches(cryptword, plainword):
possiblewords[wordnum].append(plainword)
optioncount = [(len(possiblewords[wordnum]), wordnum) for wordnum in range(len(testwords))]
optioncount.sort()
options = [possiblewords[wordnum] for wordcount, wordnum in optioncount]
cryptwords = [testwords[wordnum] for wordcount, wordnum in optioncount]
mappingsfound = recurseoptions(cryptwords, options)
if not mappingsfound:
print "impossible"
else:
for mapping in mappingsfound:
umapping = dict([(ord(unicode(a)), unicode(b)) for a, b in mapping.iteritems()])
print unicode(teststring).translate(umapping)
 
F

fishboy

I was looking through my old emails, and ran across this in a signature:

"""
-----------------------> <---------------------------
When cryptography becomes illegal, jkdf ertjgdd wer k opogl ssfd!
"""

Curious as I was, I wanted to decrypt the end. At first I thought that it
was ROT-13, and tried that. Nope. Then I saw the lone "k" in the middle, and
thought that it must be "a", so I tried ROT-16. Wrong again. I also tried
all other rotations, from 1 to 26, to no avail. Does anyone have any ideas
what to try next?

I also included the arrows, which began the signature, since I thought they
might be significant in some way...

Well, it's an anagram for 'lord dog jet fwd jerk pkg'
 
P

Peter Maas

fishboy said:
When cryptography becomes illegal, jkdf ertjgdd wer k opogl ssfd! [...]
Curious as I was, I wanted to decrypt the end. At first I thought that it
was ROT-13, and tried that. Nope. Then I saw the lone "k" in the middle, and
thought that it must be "a", so I tried ROT-16. Wrong again. I also tried
all other rotations, from 1 to 26, to no avail. Does anyone have any ideas
what to try next?
[...]
Well, it's an anagram for 'lord dog jet fwd jerk pkg'

That's the best contribution to cryptography since:

sdohtem noitpyrcne devorppa tnemnrevog troppus I

:))

Mit freundlichen Gruessen,

Peter Maas
 
C

Christos TZOTZIOY Georgiou

The attached program shows that there is no one-to-one mapping of
characters that will result in this string matching words from
/usr/share/dict/words (at least on my machine)

[snip code]

I think Richard Brodie's remark about locality of the letters was enough
to deduce that the "encrypted" text is just random keypresses. I also
think the joke is actually a well-intended prank: readers might take it
more seriously than they should, and start writing code to decrypt the
text :)
 
R

rzed

fishboy said:
When cryptography becomes illegal, jkdf ertjgdd wer k opogl
ssfd! [...]
Curious as I was, I wanted to decrypt the end. At first I
thought that it was ROT-13, and tried that. Nope. Then I saw
the lone "k" in the middle, and thought that it must be "a", so
I tried ROT-16. Wrong again. I also tried all other rotations,
from 1 to 26, to no avail. Does anyone have any ideas what to
try next?
[...]
Well, it's an anagram for 'lord dog jet fwd jerk pkg'

That's the best contribution to cryptography since:

sdohtem noitpyrcne devorppa tnemnrevog troppus I

:))

Mit freundlichen Gruessen,

Peter Maas

This thread reminds me of my favorite highly-insecure encryption
method. It does give a moment's pause to those intent on decoding
such things, and works far better with longer messages than short,
but it can bring a smile at least, and will completely fool a child
of six for several hours. Here's an example of some encoded text:

*[
Thgi snia lpn itxetht iw tpyrcedtp yrcn ednasdn ei rfruoy ezamaye.
Ko nse ri uqer dn alair et amlautxet sedo. Ce ddnas edoc nehto
(1853, 1927), bmargo rpemase ($315.23) hty lfeht noe-docedot reikc,
irteltti lasi ta h thguoh tlaffuts la utxetn on reh tod. Nas tnuo
marallo dset adhtiws kro wtimrof detpyrc neronial, pni daerebna ct
ire. Doced laut canatuo hti wnevede/tpyrced ebyl idae rn actxe
tsiht!
]*
 
P

Peter Hansen

rzed said:
This thread reminds me of my favorite highly-insecure encryption
method. It does give a moment's pause to those intent on decoding
such things, and works far better with longer messages than short,
but it can bring a smile at least, and will completely fool a child
of six for several hours. Here's an example of some encoded text:

*[
Thgi snia lpn itxetht iw tpyrcedtp yrcn ednasdn ei rfruoy ezamaye.
Ko nse ri uqer dn alair et amlautxet sedo. Ce ddnas edoc nehto
(1853, 1927), bmargo rpemase ($315.23) hty lfeht noe-docedot reikc,
irteltti lasi ta h thguoh tlaffuts la utxetn on reh tod. Nas tnuo
marallo dset adhtiws kro wtimrof detpyrc neronial, pni daerebna ct
ire. Doced laut canatuo hti wnevede/tpyrced ebyl idae rn actxe
tsiht!
]*

And, perhaps most remarkably for an encryption algorithm, it
happens to have the exact same letter-distribution frequency
as regular English! ;-)

-Peter
 
R

rzed

rzed said:
This thread reminds me of my favorite highly-insecure
encryption method. It does give a moment's pause to those
intent on decoding such things, and works far better with
longer messages than short, but it can bring a smile at least,
and will completely fool a child of six for several hours.
Here's an example of some encoded text:

*[
Thgi snia lpn itxetht iw tpyrcedtp yrcn ednasdn ei rfruoy
ezamaye. Ko nse ri uqer dn alair et amlautxet sedo. Ce ddnas
edoc nehto (1853, 1927), bmargo rpemase ($315.23) hty lfeht
noe-docedot reikc, irteltti lasi ta h thguoh tlaffuts la utxetn
on reh tod. Nas tnuo marallo dset adhtiws kro wtimrof detpyrc
neronial, pni daerebna ct ire. Doced laut canatuo hti
wnevede/tpyrced ebyl idae rn actxe tsiht!
]*

And, perhaps most remarkably for an encryption algorithm, it
happens to have the exact same letter-distribution frequency
as regular English! ;-)

-Peter

Ah yes, another feature! Although, if the message is written in
French, for instance, the distributions would dynamically adjust to
compensate.
 
J

Jason Drew

Christos "TZOTZIOY" Georgiou said:
Yes, that is the most obvious hint: it's the author's cat walking on the
keyboard and wailing after the PSU killed the ori

I noticed the keyboard locality too, but then suspected that Python
might have the sophistication to decode this, when *my* cat walked
across my keyboard and gave me the magic key:

###
magickey = 'nxxoanntrckpafqcaqaetxfnarwfb'

code = 'jkdf ertjgdd wer k opogl ssfd'
msg = []

for i in xrange(0, len(code)):
c = ord(code) + ord(magickey) - ord('a')
if c > ord('z'):
c -= 26
msg.append(chr(c))

print 'When cryptography becomes illegal,', ''.join(msg) + '?'
###

Amazingly, it worked. Then it struck me, that I don't have a cat.
 
C

Christos TZOTZIOY Georgiou

I noticed the keyboard locality too, but then suspected that Python
might have the sophistication to decode this, when *my* cat walked
across my keyboard and gave me the magic key:

###
magickey = 'nxxoanntrckpafqcaqaetxfnarwfb'
[snip of nice code to 'decrypt' the original text :) ]
Amazingly, it worked. Then it struck me, that I don't have a cat.

Of course. You have a parrot (deceased):
no Python documentation for 'a long squawk by a parrot pining for the
fjords'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top