Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CHATX - a thread starter that's not as easy as it looks.

66 views
Skip to first unread message

Richard Heathfield

unread,
Sep 20, 2021, 5:18:00 AM9/20/21
to
lFcrdtwo,econ you itelt nx
ook ohns af you sdinliofy
ttie aegtrxtxmxuxex xoxexcxyt
hhs tlxo?ixhx xsxdxtx xnxrxpx
tFar eat apcrexim,tc t semr poexx
hot cxnra prodita eua doceyctdion
a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
t-ehtrxex xhxnxix xoxkx,xax x xax
eAed danptns yenetxig
vnr hop'e sah ro.hxnx

--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

MM

unread,
Sep 20, 2021, 10:00:15 AM9/20/21
to
On Monday, 20 September 2021 at 10:18:00 UTC+1, Richard Heathfield wrote:
> lFcrdtwo,econ you itelt nx
> ook ohns af you sdinliofy
> ttie aegtrxtxmxuxex xoxexcxyt
> hhs tlxo?ixhx xsxdxtx xnxrxpx
> tFar eat apcrexim,tc t semr poexx
> hot cxnra prodita eua doceyctdion
> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
> t-ehtrxex xhxnxix xoxkx,xax x xax
> eAed danptns yenetxig
> vnr hop'e sah ro.hxnx

Staring at this, it looks like it may be only shuffling, but
with x’s added as maybe separators of some sort?

Hmmm. Where have I seen a crappy shuffle algorithm recently?

M


Richard Heathfield

unread,
Sep 20, 2021, 10:17:22 AM9/20/21
to
On 20/09/2021 15:00, MM wrote:
> On Monday, 20 September 2021 at 10:18:00 UTC+1, Richard Heathfield wrote:
>> lFcrdtwo,econ you itelt nx
>> ook ohns af you sdinliofy
>> ttie aegtrxtxmxuxex xoxexcxyt
>> hhs tlxo?ixhx xsxdxtx xnxrxpx
>> tFar eat apcrexim,tc t semr poexx
>> hot cxnra prodita eua doceyctdion
>> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
>> t-ehtrxex xhxnxix xoxkx,xax x xax
>> eAed danptns yenetxig
>> vnr hop'e sah ro.hxnx
>
> Staring at this, it looks like it may be only shuffling, but
> with x’s added as maybe separators of some sort?

A good start. I will not confirm or deny except to say that the x's are
indeed added - but not as separators as such.

> Hmmm. Where have I seen a crappy shuffle algorithm recently?

Oh, mine should be even easier to break than that. I think it's
breakable by eye alone, no computer power needed.

MM

unread,
Sep 20, 2021, 1:52:09 PM9/20/21
to
On Monday, 20 September 2021 at 15:17:22 UTC+1, Richard Heathfield wrote:
> On 20/09/2021 15:00, MM wrote:
> > Staring at this, it looks like it may be only shuffling, but
> > with x’s added as maybe separators of some sort?
> A good start. I will not confirm or deny except to say that the x's are
> indeed added - but not as separators as such.
> > Hmmm. Where have I seen a crappy shuffle algorithm recently?
> Oh, mine should be even easier to break than that. I think it's
> breakable by eye alone, no computer power needed.

Tantalising! If I assume all the x's are nulls, and delete them, then
the last group of letters on each of lines 3 and 4 suggest "encrypto".

I think my approach is too brutal. My brain hurts!

M
--

Richard Heathfield

unread,
Sep 20, 2021, 2:10:22 PM9/20/21
to
On 20/09/2021 18:52, MM wrote:
> On Monday, 20 September 2021 at 15:17:22 UTC+1, Richard Heathfield wrote:
>> On 20/09/2021 15:00, MM wrote:
>>> Staring at this, it looks like it may be only shuffling, but
>>> with x’s added as maybe separators of some sort?
>> A good start. I will not confirm or deny except to say that the x's are
>> indeed added - but not as separators as such.
>>> Hmmm. Where have I seen a crappy shuffle algorithm recently?
>> Oh, mine should be even easier to break than that. I think it's
>> breakable by eye alone, no computer power needed.
>
> Tantalising!

Good! :-)

One small hint to save you some pain...

> If I assume all the x's are nulls, and delete them, then
> the last group of letters on each of lines 3 and 4 suggest "encrypto".

You are right that the x's must be removed, but I think removing them at
the beginning would be a stupendously bad idea. They do have a purpose.

You are also correct that the word "encrypt" appears in the original.

Max

unread,
Sep 20, 2021, 2:36:49 PM9/20/21
to
On 20.09.21 11:17, Richard Heathfield wrote:
> lFcrdtwo,econ you itelt nx
> ook ohns  af you sdinliofy
> ttie aegtrxtxmxuxex xoxexcxyt
> hhs tlxo?ixhx xsxdxtx xnxrxpx
> tFar eat apcrexim,tc t semr poexx
> hot cxnra prodita eua doceyctdion
> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
> t-ehtrxex xhxnxix xoxkx,xax x xax
> eAed danptns yenetxig
> vnr hop'e sah ro.hxnx
>



eI nhvtr siie aiyhhrn ui
teae. Nacd cnptei,gbltk
ht stteo. aey' olf lno
tie' hos eLst sta loullw
ook hhssglmc.dCwe!r han
fcr ttii aoek ohne sTMaxx

Richard Heathfield

unread,
Sep 20, 2021, 2:42:23 PM9/20/21
to
Ladies and gentlemen, we have a winner!

Max

unread,
Sep 20, 2021, 2:50:06 PM9/20/21
to
On 20.09.21 20:42, Richard Heathfield wrote:
> On 20/09/2021 19:36, Max wrote:
>> On 20.09.21 11:17, Richard Heathfield wrote:
>>> lFcrdtwo,econ you itelt nx
>>> ook ohns  af you sdinliofy
>>> ttie aegtrxtxmxuxex xoxexcxyt
>>> hhs tlxo?ixhx xsxdxtx xnxrxpx
>>> tFar eat apcrexim,tc t semr poexx
>>> hot cxnra prodita eua doceyctdion
>>> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
>>> t-ehtrxex xhxnxix xoxkx,xax x xax
>>> eAed danptns yenetxig
>>> vnr hop'e sah ro.hxnx
>>>
>>
>>
>>
>> eI nhvtr siie  aiyhhrn  ui
>>    teae. Nacd  cnptei,gbltk
>>    ht stteo.  aey'  olf lno
>> tie'  hos  eLst sta loullw
>>   ook  hhssglmc.dCwe!r  han
>> fcr ttii  aoek ohne sTMaxx
>
>
> Ladies and gentlemen, we have a winner!
>

That was fun. Thank you for this great idea. :-)

wizzofozz

unread,
Sep 20, 2021, 3:43:06 PM9/20/21
to
Op 20-9-2021 om 20:42 schreef Richard Heathfield:
> On 20/09/2021 19:36, Max wrote:
>> On 20.09.21 11:17, Richard Heathfield wrote:
>>> lFcrdtwo,econ you itelt nx
>>> ook ohns  af you sdinliofy
>>> ttie aegtrxtxmxuxex xoxexcxyt
>>> hhs tlxo?ixhx xsxdxtx xnxrxpx
>>> tFar eat apcrexim,tc t semr poexx
>>> hot cxnra prodita eua doceyctdion
>>> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
>>> t-ehtrxex xhxnxix xoxkx,xax x xax
>>> eAed danptns yenetxig
>>> vnr hop'e sah ro.hxnx
>>>
>>
>>
>>
>> eI nhvtr siie  aiyhhrn  ui
>>    teae. Nacd  cnptei,gbltk
>>    ht stteo.  aey'  olf lno
>> tie'  hos  eLst sta loullw
>>   ook  hhssglmc.dCwe!r  han
>> fcr ttii  aoek ohne sTMaxx
>
>

Good for you, Max! I'm working on it, but it may take a while ..

> Ladies and gentlemen, we have a winner!
>



Ozz

Max

unread,
Sep 20, 2021, 3:50:20 PM9/20/21
to
Serendipity. Have fun! :-)

Richard Heathfield

unread,
Sep 20, 2021, 4:02:54 PM9/20/21
to
SPOILER: Read no further if you want to finish on your own.
SPOILER: Read no further if you want to finish on your own
SPOILER: Read no further if you want to finish on your ow
SPOILER: Read no further if you want to finish on your o
SPOILER: Read no further if you want to finish on your
SPOILER: Read no further if you want to finish on your
SPOILER: Read no further if you want to finish on you
SPOILER: Read no further if you want to finish on yo
SPOILER: Read no further if you want to finish on y
SPOILER: Read no further if you want to finish on
SPOILER: Read no further if you want to finish on
SPOILER: Read no further if you want to finish o
SPOILER: Read no further if you want to finish
SPOILER: Read no further if you want to finish
SPOILER: Read no further if you want to finis
SPOILER: Read no further if you want to fini
SPOILER: Read no further if you want to fin
SPOILER: Read no further if you want to fi
SPOILER: Read no further if you want to f
SPOILER: Read no further if you want to
SPOILER: Read no further if you want to
SPOILER: Read no further if you want t
SPOILER: Read no further if you want
SPOILER: Read no further if you want
SPOILER: Read no further if you wan
SPOILER: Read no further if you wa
SPOILER: Read no further if you w
SPOILER: Read no further if you
SPOILER: Read no further if you
SPOILER: Read no further if yo
SPOILER: Read no further if y
SPOILER: Read no further if
SPOILER: Read no further if
SPOILER: Read no further i
SPOILER: Read no further
SPOILER: Read no further
SPOILER: Read no furthe
SPOILER: Read no furth
SPOILER: Read no furt
SPOILER: Read no fur
SPOILER: Read no fu
SPOILER: Read no f
SPOILER: Read no
SPOILER: Read no
SPOILER: Read n
SPOILER: Read
SPOILER: Read
SPOILER: Rea
SPOILER: Re
SPOILER: R
SPOILER:
SPOILER:
SPOILER
SPOILE
SPOIL
SPOI
SPO
SP
S



Encryption:

Read a PAIR of lines from input. If one is shorter, pad it with 'x's. If
the lines are an odd number of characters long, add an 'x' to each.

You now have your input:

ABCDEFGHIJKL
MNOPQRSTUVWx

Think of it as squares of 2x2 characters:

AB CD EF GH IJ KL
MN OP QR ST UV Wx

Rotate each square 90 deg clockwise:

MA OC QE SG UI WK
NB PD RF TH VJ xL

That's the whole thing.

Max

unread,
Sep 20, 2021, 4:24:52 PM9/20/21
to
On 20.09.21 22:02, Richard Heathfield wrote:
> On 20/09/2021 19:50, Max wrote:
>> On 20.09.21 20:42, Richard Heathfield wrote:
>>> On 20/09/2021 19:36, Max wrote:
>>>> On 20.09.21 11:17, Richard Heathfield wrote:
>>>>> lFcrdtwo,econ you itelt nx
>>>>> ook ohns  af you sdinliofy
>>>>> ttie aegtrxtxmxuxex xoxexcxyt
>>>>> hhs tlxo?ixhx xsxdxtx xnxrxpx
>>>>> tFar eat apcrexim,tc t semr poexx
>>>>> hot cxnra prodita eua doceyctdion
>>>>> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
>>>>> t-ehtrxex xhxnxix xoxkx,xax x xax
>>>>> eAed danptns yenetxig
>>>>> vnr hop'e sah ro.hxnx
>>>>>
>>>>
>>>>
>>>>
>>>> eI nhvtr siie  aiyhhrn  ui
>>>>    teae. Nacd  cnptei,gbltk
>>>>    ht stteo.  aey'  olf lno
>>>> tie'  hos  eLst sta loullw
>>>>   ook  hhssglmc.dCwe!r  han
>>>> fcr ttii  aoek ohne sTMaxx
>>>
>>>
>>> Ladies and gentlemen, we have a winner!
>>>
>>
>> That was fun. Thank you for this great idea. :-)
>
>
> SPOILER: Read no further if you want to finish on your own.

Hey, Richard, no need for spoilers, is there? You took some time to make
this and there are still people working on it. If you don't mind, I
would prepare the next cipher, but I won't be able to do so before the
weekend.

Richard Heathfield

unread,
Sep 20, 2021, 5:08:23 PM9/20/21
to
I thought I should post an explanation whilst it's still clear in my
head, not least because it's been cracked. Anyone who wants to finish
the puzzle, as it were, need only not scroll down past the spoiler warning.

> I
> would prepare the next cipher, but I won't be able to do so before the
> weekend.

That's the ticket! I think it does this group no harm to post ciphers
from time to time, to give cryptanalysts something to practise on.

Richard Harnden

unread,
Sep 21, 2021, 10:07:15 AM9/21/21
to
On 20/09/2021 10:17, Richard Heathfield wrote:
> lFcrdtwo,econ you itelt nx
> ook ohns  af you sdinliofy
> ttie aegtrxtxmxuxex xoxexcxyt
> hhs tlxo?ixhx xsxdxtx xnxrxpx
> tFar eat apcrexim,tc t semr poexx
> hot cxnra prodita eua doceyctdion
> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
> t-ehtrxex xhxnxix xoxkx,xax x xax
> eAed danptns yenetxig
> vnr hop'e sah ro.hxnx
>

pTseiplo lomtil hht ii fsr'nxex
ohs brebte eslttae dtfienetcxxx
abdtxesnaxdsdabdcduae wa dend,elck xhxsx:xxxx
ne w-e d-e deea ss pednieg aihextxexex xxxx
xpxix xfxlxnxsxtx xextxexsxmx xexgxh
xaxrxox xixex xoxbx xhx xaxexlxnxtx.

Phil Carmody

unread,
Sep 21, 2021, 10:17:21 AM9/21/21
to
Richard Heathfield <r...@cpax.org.uk> writes:

OK, I'm too slow, so at least I can have a stab...


tTealkt lo
hh nistfer
tbaaen
ersirx


Original and winning solution left as spoiler space.


This is how I approached it - very low-tech, perhaps a bit too manual.



> On 20/09/2021 19:36, Max wrote:
>> On 20.09.21 11:17, Richard Heathfield wrote:
>>> lFcrdtwo,econ you itelt nx
>>> ook ohns  af you sdinliofy
>>> ttie aegtrxtxmxuxex xoxexcxyt
>>> hhs tlxo?ixhx xsxdxtx xnxrxpx
>>> tFar eat apcrexim,tc t semr poexx
>>> hot cxnra prodita eua doceyctdion
>>> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
>>> t-ehtrxex xhxnxix xoxkx,xax x xax
>>> eAed danptns yenetxig
>>> vnr hop'e sah ro.hxnx
>>>
>>
>>
>>
>> eI nhvtr siie  aiyhhrn  ui
>>   teae. Nacd  cnptei,gbltk
>>   ht stteo.  aey'  olf lno
>> tie'  hos  eLst sta loullw
>>  ook  hhssglmc.dCwe!r  han
>> fcr ttii  aoek ohne sTMaxx
>
>
> Ladies and gentlemen, we have a winner!

1st, 5th and 7th lines have capital letters in the 2nd column
=> pairs of characters may have been swapped (at least in odd lines)

"algorithm", "encrypt", "decryption" half-readable, and missing
letters appear to be on the next line
=> odd and even lines come in pairs.

So, first stab:

$ echo "lFcrdtwo,econ you itelt nx
ook ohns af you sdinliofy
ttie aegtrxtxmxuxex xoxexcxyt
hhs tlxo?ixhx xsxdxtx xnxrxpx
tFar eat apcrexim,tc t semr poexx
hot cxnra prodita eua doceyctdion
a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
t-ehtrxex xhxnxix xoxkx,xax x xax
eAed danptns yenetxig
vnr hop'e sah ro.hxnx
" | perl -pe 's/(.)(.)/$2$1/g if($.&1)'
Flrctdowe,oc noy utile txn
ook ohns af you sdinliofy
tteia gerttxmxuxex xoxexcxyxt
hhs tlxo?ixhx xsxdxtx xnxrxpx
Ftrae taa cperix,mctt s me ropxex
hot cxnra prodita eua doceyctdion
-a tasd.rxtxax xtxlxoxsx xsxIxcxn
t-ehtrxex xhxnxix xoxkx,xax x xax
Aeded natpsny neteixg
vnr hop'e sah ro.hxnx

Zigzag pattern shows the words more clearly now
=> keep that idea, isolate the black squares from the white ones

White:

[...] | perl -pe 's/(.)(.)/$2 /g if($.&1);s/(.)(.)/ $2/g if($.%2==0)'
F r t o e o o t l x
o h s f y u s i l o y
t e a g r t m u e o e c y t
h l o i h s d t n r px
F r e t a c e i , c t s m o x x
o x r r d t u o e c d on
- a d r t a t l o s s I c n
- h r e h n i o k , a ax
A d d n t s y n t i g
n o ' a o h nx

For those of you still oxy
the algorithm used to encrypt
For extra credit, cut some codxox
-- harder than it looks, as I can
And don't say nothing

=> This is good, keep it, although note that the line endings are broken
in places, due to dumb (ie. no) handling of odd-length lines in the script.
I'll just overlook such stray characters for now

Black:

[...] | perl -pe 's/(.)(.)/ $1/g if($.&1);s/(.)(.)/$1 /g if($.%2==0)'
l c d w , c n y u i e t n
o k o n a o d n i f
t i e t x x x x x x x x xt
h s t x ? x x x x x x x x x x
t a a p r x m t e r p ex
h t c n a p o i a e a d c y t i n
a t s . x x x x x x x x x x x xn
t e t x x x x x x x x x x x x x x
e e a p n e e xg
v r h p e s h r . x x

=> Ooops, however, words are vaguely visible, reverse the swapping

l c d w , c n y u i e t n
o k o n a o d n i f
t i e t x x x x x x x x x t
h s t x ? x x x x x x x x xx
t a a p r x m t e r p e x
h t c n a p o i a e a d c y t in
a t s . x x x x x x x x x x x x n
t e t x x x x x x x x x x x x xx
e e a p n e e x g
v r h p e s h r . xx

lockdown, can you identinf
this text?xxxxxxxxxxxxxxxxxxt
that can approximate a decrypteix
attest.xxxxxxxxxxxxxxxxxxxxxxxxxn
ever happens here.xxg

=> apart from the line endings, we've got English again.
Let's interleave the two halves back together:

For those of you still oxy
lockdown, can you identinf
this text?xxxxxxxxxxxxxxxxxxt
the algorithm used to encrypt
For extra credit, cut some codxox
that can approximate a decrypteix
-- harder than it looks, as I can
attest.xxxxxxxxxxxxxxxxxxxxxxxxxn
And don't say nothing
ever happens here.xxg

=> Errors in line endings mostly cancel out and can be fixed up/ignored
by eye.

But we're left with the question of what transformation has really
been done. So let's analyse this algorithm on a simpler cyphertext,
knowing as we do that 2x2 blocks are important as it's pairs of
characters and pairs of lines that are relevant:

Black:
echo "12abWX
34cdYZ" | perl -pe 's/(.)(.)/$2 /g if($.&1);s/(.)(.)/ $2/g if($.%2==0)'
2 b X
4 d Z
= 24bdXZ

White:
echo "12abWX
34cdYZ" | perl -pe 's/(.)(.)/$1 /g if($.&1);s/(.)(.)/ $1/g if($.%2==0)'
1 a W
3 c Y
= 13acWY

Interleaved:
24bdXZ
13acWY

So each block of 4 has been rotated clockwise to encrypt.

Nicely done both!

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Richard Heathfield

unread,
Sep 21, 2021, 10:18:47 AM9/21/21
to
That's certainly one of the problems, yes. Another is that I rushed the
whole cryptosystem through from conception through software
implementation to publication for competitive peer review in about
twelve minutes all told. So I cannot guarantee that other problems may
not also become apparent. (I can reveal, for example, that my decryption
code does a workmanlike but less than stellar job and isn't about to win
any prizes.)

I can report one important theoretical discovery about the system: it
turns out *not* to be informational-theoretically secure. Who'd ha'
thunk it, eh?

Richard Heathfield

unread,
Sep 21, 2021, 10:22:03 AM9/21/21
to
On 21/09/2021 15:00, Phil Carmody wrote:
> Nicely done both!

And a fine blow-by-blow account of your analysis.

Phil Carmody

unread,
Sep 21, 2021, 2:43:16 PM9/21/21
to
Richard Heathfield <r...@cpax.org.uk> writes:
> I can report one important theoretical discovery about the system: it
> turns out *not* to be informational-theoretically secure. Who'd ha'
> thunk it, eh?

It's also remarkably readable, once you know what you're doing.

Richard Heathfield

unread,
Sep 21, 2021, 3:41:10 PM9/21/21
to
On 21/09/2021 19:43, Phil Carmody wrote:
> Richard Heathfield <r...@cpax.org.uk> writes:
>> I can report one important theoretical discovery about the system: it
>> turns out *not* to be informational-theoretically secure. Who'd ha'
>> thunk it, eh?
>
> It's also remarkably readable, once you know what you're doing.

Yes, I was surprised by that too; it was then that I suggested to MM
that it might be crackable by eye. A pencil and paper cipher, really, of
the "secure vs your kid sister" variety. (I am of course referring to
Schneier's opening to Applied Cryptography.)

Max

unread,
Sep 21, 2021, 5:31:31 PM9/21/21
to
On 21.09.21 16:00, Phil Carmody wrote:
> Richard Heathfield <r...@cpax.org.uk> writes:
>


[...]

>
>
> This is how I approached it - very low-tech, perhaps a bit too manual.

Very nice explanation of your approach. I think doing it low-tech gets
the most fun out of puzzles like this.

Yet, tbh, I started with a frequency analysis, just to know, what I was
up against. It looked very English.

Next, I took Richard's advice to heart, to eyeball this. And the first
thing to look for in English texts are the "th"s, amIright? So I
realized, there were no "th"s across, but 4 down. Especially the 3 at
the left stood out, so I looked around and stumbled across the matching
"e ", "is" and "at" in the neighborhood. From there I kept going and
when I was sure that it made sense, I Excelled (rather Gnumericed) the
rest out of the ciphertext. Too bad, I can't post this here. Great idea
of you to do all of this in bash/Perl so you can share your work here.

So, to make my answer just that extra bit harder to crack, I used extra
spaces to split up the "th"s and made lines of equal length.

>
>
>

[...]

>
> So each block of 4 has been rotated clockwise to encrypt.

Argh! Of course! I didn't see that.

>
> Nicely done both!

That was indeed a nice puzzle. Not just "crack by numbers", but also not
too hard to get frustrated. Great job, Richard.

>
> Phil
>

Max

Richard Heathfield

unread,
Sep 21, 2021, 6:03:21 PM9/21/21
to
On 21/09/2021 22:31, Max wrote:

<snip>

>
> Argh! Of course! I didn't see that.

"That" being the entire encryption algorithm. So it would appear that
you had no idea how the encryption actually worked. (Extra credit to
Phil for spotting that.) Yet you were still the first who was able to
encode a message in such a way that my decrypter worked on it.

I hope Austin is reading, because this is typical Eve thinking. Max
didn't have any idea of the workings of the algorithm, but he still came
up with a speedy crack *and* was able to mimic the encryption process
without knowing the underlying logic in that process.

Austin, you can't assume that Eve will play by your rules. Eves are
tricksy buggerses, and they have all manner of nasssty things in their
pocketses. Never take Eve for granted.

Max

unread,
Sep 21, 2021, 6:22:37 PM9/21/21
to
On 22.09.21 00:03, Richard Heathfield wrote:
> On 21/09/2021 22:31, Max wrote:
>
> <snip>
>
>>
>> Argh! Of course! I didn't see that.
>
> "That" being the entire encryption algorithm. So it would appear that
> you had no idea how the encryption actually worked.

No. But I found a different algorithm (the zigzag-pattern) that led to
the same result.

> (Extra credit to
> Phil for spotting that.) Yet you were still the first who was able to
> encode a message in such a way that my decrypter worked on it.
>
> I hope Austin is reading, because this is typical Eve thinking. Max
> didn't have any idea of the workings of the algorithm, but he still came
> up with a speedy crack *and* was able to mimic the encryption process
> without knowing the underlying logic in that process.
>
> Austin, you can't assume that Eve will play by your rules. Eves are
> tricksy buggerses, and they have all manner of nasssty things in their
> pocketses. Never take Eve for granted.
>

Well said.

wizzofozz

unread,
Sep 24, 2021, 8:24:52 PM9/24/21
to
Op 20-9-2021 om 11:17 schreef Richard Heathfield:
> lFcrdtwo,econ you itelt nx
> ook ohns  af you sdinliofy
> ttie aegtrxtxmxuxex xoxexcxyt
> hhs tlxo?ixhx xsxdxtx xnxrxpx
> tFar eat apcrexim,tc t semr poexx
> hot cxnra prodita eua doceyctdion
> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
> t-ehtrxex xhxnxix xoxkx,xax x xax
> eAed danptns yenetxig
> vnr hop'e sah ro.hxnx
>

Here's my contribution (finally). I resisted the urge to look at the
spoilers, but the hint from Richard to MM (about the word "encrypt") did
help.
I had to add some spaces at the end of some lines below to make them
equal length (copy/paste thingy). I also may have made some off-by-one
error somewhere in the decryption.

yI mua b tilatl oot etpxr
,'b t Iif naleytg thi .axt
yIlpooiigeaI dhd 'p iheas
orkmns t tienstoclert,b
taRtcoagd iate to dMid dh
lihhurhsIhhnvs foraMm titxa
.hxl
xexp
mT rape tni ge riph u cnilnd.d
yocmykt ahdndscrygttfInitcousex
mBnt na eranf lonsmd us.axg
eothatdkp i tite ateoat xrxu
Ihmtnstwsyrt eoe atehtnalysie physltnxs.s
t'a 'o hu ehhrw ir na dne nmtti ieet xo
tIa betrwpisdRtcoagd. xe
t dic yetr ihhurhsxtxx
lIn llnotp,do hirei eoma mnlripli nfx4
iteaesg ha stlenwsst y euctypteoox x
amlt.ox
ieshxdxf
rbps.6y
yatep4xc
oIeE1dcNVLKJNbc95ecRdbW4FaK15bZJFIbNlc
KyDvvXGyu2Hp5iywhXmo22zKdWSwy3W0kHG5uw
5ZcMRKaoAZJ9xIJwkaI4AeIoxIdAAIIBxIb0hb
yX3oyQXKom1yuGygKWCggDGKwCCg9HG0lDigwC
AdIkBIdAAIPlAIexIdKAQIbQBIJ0QMCoAIIAAI
gCCKwCCgrGSmiGCwqCDltDHg0TTgpDiKgCCggC
BILAIbaB0Ic0RbaV0KZB9KIooIaA4Yc1FcZRUb
0CzgrHl0rDHgbGlugHm0yQGggCWggjmbuH2boH
tbXBBLbIIXaoBIbABcYJ5bZQhIZI4aY9kbIhlY
pHS0mz3pgQSgpCigyHWpnnSgsiWuomippiGbml
9IbkhJYAtIX0BIbBIKaoBIbABcYJ5bZQhIZI4a
pGigbSlypDS9mD3dgQSgpCigyHWpnnSgsiWuom
IYFkKIolIIAkIJoACI=0
DidpQGKmCGggASKygD=9
rbps.6y xe
yatep4xdxc
MICEgdbNBLbJhbe9MeYRJbd4sCXlkcc9VdZBxe
Kynv9X3yl2ipziXwuXXon2lKxmStuGmyhCGzpX
4bYVkKIk0CbRVZKBIKOEoYIkACIAAIIBBZaB5Z
omSzgCTKgmGluiGtpGgsgiC6giCggCHpyiWs0W
YIbJEYMQ0CMAoIIBAYIAAIIxBbKh0KIoIIIAAa
gCGilWji9iDgKCCsgSC9gGClhizhiQCgKCCggW
AIIABIPBEKI0AIIIBIPAIICAAIIBBYaAlPZABC
gCCgpCTiKzCigCHK0CSgiCiggCCs3SGrsSSxpi
xIXwAbIEJMaoVIYA0ICAAIIBAdIAAPaAAYPtAJ
hDSgrGGqbjSKsCVgpCiggCCwgCCrgSSorVSpyW
dCKAxIbBhZKR8cK4ocIQACIZBcaB5IIl0IeJtb
liGglCiy4XS1ymTgKHCKgmHvyiWs0GGuoHFhsm
bKsJXL5JcdRJacAgJXx4JKkxCWoI
CjxdSnyz3HypXCon1GunySp4gzKq
zO
xz

Richard Heathfield

unread,
Sep 25, 2021, 12:24:12 AM9/25/21
to
On 25/09/2021 01:24, wizzofozz wrote:
> Here's my contribution (finally). I resisted the urge to look at the
> spoilers, but the hint from Richard to MM (about the word "encrypt") did
> help.
> I had to add some spaces at the end of some lines below to make them
> equal length (copy/paste thingy). I also may have made some off-by-one
> error somewhere in the decryption.


I got the gist of your enciphered message, but I think I should confess
(as I've already hinted upthread) that my decipher code didn't do a
stellar job, cobbled together as it was in a few minutes, so I'm not
surprised that others, too, have struggled a bit with decryption. I
suspect I went from Grand Concept to Code Central far too quickly
without lingering long enough in Thought Parkway.

Congratulations, therefore are certainly due to yourself and others who
managed to bolt a few missing wheels onto my train.

CHAL2 is very different. I have tested encryption and decryption
thoroughly, and have even gone to the trouble of doing the bitmap header
thing to make encrypted bitmaps viewable, and it works both ways (bmp ->
encrypted viewable bitmap -> decrypted original file).

So the second challenge is fair.

No takers so far, so you're not too late!

wizzofozz

unread,
Sep 25, 2021, 7:29:49 AM9/25/21
to
Op 21-9-2021 om 16:00 schreef Phil Carmody:
I could not ignore "two" after a while, which was a bit annoying. I also
kept seeing "recon" and "approximation", somehow.
The frequency count did immediately say "transposition".
The strange thing is, that I pretty early saw that encrypt was spelled
over two lines, but I did not seriously follow up on it. Later this was
key of course.

> Zigzag pattern shows the words more clearly now
> => keep that idea, isolate the black squares from the white ones
>
> White:
>
> [...] | perl -pe 's/(.)(.)/$2 /g if($.&1);s/(.)(.)/ $2/g if($.%2==0)'
> F r t o e o o t l x
> o h s f y u s i l o y
> t e a g r t m u e o e c y t
> h l o i h s d t n r px
> F r e t a c e i , c t s m o x x
> o x r r d t u o e c d on
> - a d r t a t l o s s I c n
> - h r e h n i o k , a ax
> A d d n t s y n t i g
> n o ' a o h nx
>

I like this seperation. When I figured out how it worked I guess I shot
myself in the foot by keeping all text.


> Black:
> echo "12abWX
> 34cdYZ" | perl -pe 's/(.)(.)/$2 /g if($.&1);s/(.)(.)/ $2/g if($.%2==0)'
> 2 b X
> 4 d Z
> = 24bdXZ
>
> White:
> echo "12abWX
> 34cdYZ" | perl -pe 's/(.)(.)/$1 /g if($.&1);s/(.)(.)/ $1/g if($.%2==0)'
> 1 a W
> 3 c Y
> = 13acWY
>
> Interleaved:
> 24bdXZ
> 13acWY
>
> So each block of 4 has been rotated clockwise to encrypt.

When I finally came to implementing the encryption I figured I needed to
make every line length a multiple of 4. This is probably related.
I like the perl onelines, but I always find perl a bit hard to read.
My solutions also have the mod 2 = 1/0 , but that's probably logical.

In my other post I encrypted base64 encodings of my python solutions.
Here are my versions (finalized late at night so a bit messy as usual):

decrypt:
#!/usr/bin/python

import sys

x=open(sys.argv[1]).readlines()

def m(a,b):
if len(a) != len(b):
print "bad"
la = len(a)
if la%2==0:
a+=" "
b+=" "
la += 1
i=1
pt=""
while i < la*2:
pt += (a[i%la] + b[i%la])
i += 2
return pt

for l in range(len(x)/2):
print m(x[l*2].rstrip('\n'),x[2*l+1].rstrip('\n'))



encrypt:
#!/usr/bin/python
import sys

x=open(sys.argv[1]).readlines()

for l in x:
pt = l.rstrip('\n')
lpt = len(pt)
if lpt % 4 != 0:
pt += "x"*(4-lpt%4)
lpt = len(pt)
b=[pt[lpt/2+j]+pt[j] for j in range(lpt/2)]
print "".join([b[i] for i in range(len(b)) if i % 2 == 0])
print "".join([b[i] for i in range(len(b)) if i % 2 == 1])


Ozz













Richard Harnden

unread,
Sep 25, 2021, 8:56:33 AM9/25/21
to
On 20/09/2021 10:17, Richard Heathfield wrote:
> lFcrdtwo,econ you itelt nx
> ook ohns  af you sdinliofy
> ttie aegtrxtxmxuxex xoxexcxyt
> hhs tlxo?ixhx xsxdxtx xnxrxpx
> tFar eat apcrexim,tc t semr poexx
> hot cxnra prodita eua doceyctdion
> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
> t-ehtrxex xhxnxix xoxkx,xax x xax
> eAed danptns yenetxig
> vnr hop'e sah ro.hxnx
>

Here's my chatx encoder/decoder effort.
I spent far too much time on this.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_LINE 1024

typedef void (*chatx_t)(FILE *in);

static int encode_read_pair(FILE *in, char *a, char *b)
{
int a_length;
int b_length;
char *z;

if ( fgets(a, MAX_LINE, in) == NULL )
return 0;

z = strchr(a, '\n');
if ( z == NULL )
{
fprintf(stderr, "Line too long.\n");
exit(EXIT_FAILURE);
}

*z = '\0';
a_length = z - a;

if ( fgets(b, MAX_LINE, in) == NULL )
b_length = 0;
else
{
z = strchr(b, '\n');
if ( z == NULL )
{
fprintf(stderr, "Line too long.\n");
exit(EXIT_FAILURE);
}

*z = '\0';
b_length = z - b;
}

if ( a_length == 0 )
{
a_length = 2;
a[0] = 'x';
a[1] = 'x';
a[2] = '\0';
}
else
{
if ( a_length % 2 == 1 )
{
a[a_length++] = 'x';
a[a_length] = '\0';
}
}

if ( b_length == 0 )
{
b_length = 2;
b[0] = 'x';
b[1] = 'x';
b[2] = '\0';
}
else
{
if ( b_length % 2 == 1 )
{
b[b_length++] = 'x';
b[b_length] = '\0';
}
}

if ( a_length > b_length )
{
for (int i=b_length; i<a_length; i++)
b[i] = 'x';

b_length = a_length;
b[b_length] = '\0';
}

if ( b_length > a_length )
{
for (int i=a_length; i<b_length; i++)
a[i] = 'x';

a_length = b_length;
a[a_length] = '\0';
}

return a_length;
}

static void chatx_encode(FILE *in)
{
char a[MAX_LINE];
char b[MAX_LINE];
char c[MAX_LINE];
char d[MAX_LINE];
int length;
char p,q,r,s;
int c_pos;
int d_pos;

while (1)
{
c_pos = 0;
d_pos = 0;

if ( (length = encode_read_pair(in, a, b)) == 0 )
break;

for (int i=0; i<length; i+=2)
{
p = a[i];
q = a[i+1];
r = b[i];
s = b[i+1];

c[c_pos++] = r;
c[c_pos++] = p;

d[d_pos++] = s;
d[d_pos++] = q;
}

c[length] = '\0';
d[length] = '\0';

puts(c);
puts(d);
}
}

static int decode_read_pair(FILE *in, char *a, char *b)
{
int a_length;
int b_length;
char *z;

if ( fgets(a, MAX_LINE, in) == NULL )
return 0;

z = strchr(a, '\n');
if ( z == NULL )
{
fprintf(stderr, "Line too long.\n");
exit(EXIT_FAILURE);
}

*z = '\0';
a_length = z - a;

if ( fgets(b, MAX_LINE, in) == NULL )
{
fprintf(stderr, "Expected pair of lines.\n");
exit(EXIT_FAILURE);
}

z = strchr(b, '\n');
if ( z == NULL )
{
fprintf(stderr, "Line too long.\n");
exit(EXIT_FAILURE);
}

*z = '\0';
b_length = z - b;

if ( a_length != b_length )
{
fprintf(stderr, "Line pair has different lengths.");
exit(EXIT_FAILURE);
}

if ( a_length % 2 != 0 )
{
fprintf(stderr,
"Expected lines to be even number of characters.");
exit(EXIT_FAILURE);
}

return a_length;
}

static void chatx_decode(FILE *in)
{
char a[MAX_LINE];
char b[MAX_LINE];
char c[MAX_LINE];
char d[MAX_LINE];
int length;
char p,q,r,s;
int c_pos;
int d_pos;

while (1)
{
c_pos = 0;
d_pos = 0;

if ( (length = decode_read_pair(in, a, b)) == 0 )
break;

for (int i=0; i<length; i+=2)
{
p = a[i];
q = a[i+1];
r = b[i];
s = b[i+1];

c[c_pos++] = q;
c[c_pos++] = s;

d[d_pos++] = p;
d[d_pos++] = r;
}

c[length] = '\0';
d[length] = '\0';

puts(c);
puts(d);
}
}

int main(int argc, char *argv[])
{
chatx_t chatx = chatx_encode;

if ( argc > 2 )
{
fprintf(stderr, "Usage: %s [-d]\n", argv[0]);
return EXIT_FAILURE;
}

if ( argc == 2 )
{
if ( strcmp(argv[1], "-d") == 0 )
chatx = chatx_decode;
else
{
if ( strcmp(argv[1], "-e") == 0 )
chatx = chatx_encode;
else
{
fprintf(stderr, "Usage: %s [-d]\n", argv[0]);
return EXIT_FAILURE;
}
}
}

chatx(stdin);

return 0;
}

Richard Heathfield

unread,
Sep 25, 2021, 9:21:49 AM9/25/21
to
I tried it on the puzzle ciphertext and came across an oddity.


rjh@here$ ./hdc < t3.cipher
olkcodnw ,ac noy udineitfn
oF rhtso efoy uos itllo yx
htsit xe?txxxxxxxxxxxxxxxxxxxt
ht elaogirht msudet onercpyxx
httac naa pporixameta d ceyrtpienx
oF rxert arcdeti ,uc tosemc dooxxx
taettsx.xxxxxxxxxxxxxxxxxxxxxxxxxn
--h raed rhtnai tolko,sa s Iacxx
vereh paepsnh re.exxxg
nA dod'n tas yonhtnixx
rjh@here$ cat t3.cipher | wc -l
10
rjh@here:~/alldata/dev/crypto/sqspin/harndendecrypt$ ./hdc -d < t3.cipher
For those of you still oxy
lockdown, can you identinf
Expected lines to be even number of characters.

Last I checked, 10 is even. :-)


NO! For heaven's sake don't waste time fixing it on my account. My
decoder's screwed too and I'm letting it go.

Richard Heathfield

unread,
Sep 25, 2021, 9:28:21 AM9/25/21
to
On 25/09/2021 14:21, Richard Heathfield wrote:
> I tried it on the puzzle ciphertext and came across an oddity.
>
>
> rjh@here$ ./hdc < t3.cipher

I didn't mean to post that!

Broadly:

Step 1: wc -l reports 10 lines of ciphertext.
Step 2: Richard Harnden's decoder reports odd number of lines.
Step 3: Contemplate that Richard Heathfield's decoder is screwed too.
Step 4: Break open a beer.

wizzofozz

unread,
Sep 25, 2021, 10:11:53 AM9/25/21
to
Op 25-9-2021 om 14:56 schreef Richard Harnden:
> On 20/09/2021 10:17, Richard Heathfield wrote:
>> lFcrdtwo,econ you itelt nx
>> ook ohns  af you sdinliofy
>> ttie aegtrxtxmxuxex xoxexcxyt
>> hhs tlxo?ixhx xsxdxtx xnxrxpx
>> tFar eat apcrexim,tc t semr poexx
>> hot cxnra prodita eua doceyctdion
>> a-t sa.dxrxtxax xtxlxoxsx xsxIxcn
>> t-ehtrxex xhxnxix xoxkx,xax x xax
>> eAed danptns yenetxig
>> vnr hop'e sah ro.hxnx
>>
>
> Here's my chatx encoder/decoder effort.
> I spent far too much time on this.

That's a bit inherit to accepting these kind of tasks.
I tried your version (reading from stdin and encrypt) and it seems to be
compatible with my decrypt. So just to let you know it compiles on my
system and has been run by at least 3 people now. Your time has not
been wasted ;-) (as a side effect I had to install gcc in my WSL which
is good use of my time as well).

Ozz


Phil Carmody

unread,
Sep 26, 2021, 7:55:26 AM9/26/21
to
Assuming I've got the line ending/length protocols correct:

--- 8< ---- encoder -----
#!/usr/bin/perl -w
use strict;
use warnings;
my ($it,$ib);
while(defined($it=<>) and defined($ib=<>)) {
chomp($it); chomp($ib);
my ($lt,$lb)=(length($it),length($ib));
if($lt&1) { $it.=' '; $lt++; }
if($lb&1) { $ib.=' '; $lb++; }
if($lt<$lb) { $it.='x'x($lb-$lt); $lt=$lb; }
if($lt>$lb) { $ib.='x'x($lt-$lb); $lb=$lt; }
for my $o (0..1) {
for(my $i=0; $i<$lt; $i+=2) {
print(substr($ib,$i+$o,1),substr($it,$i+$o,1));
}
print("\n");
}
}
--- 8< ---- encoder test -----
echo "For those of you still on
lockdown, can you identify
the algorithm used to encrypt
this text?
For extra credit, cut some code
that can approximate a decryption
-- harder than it looks, as I can
attest.
And don't say nothing
ever happens here." | perl r4.pl
lFcrdtwo,econ you itelt fn
ook ohns af you sdinlioy
ttie aegtrxtxmxuxex xoxexcxyxt
hhs tlxo?ixhx xsxdxtx xnxrxpx
tFar eat apcrexim,tc t semr poienx
hot cxnra prodita eua doceyctdo x
a-t sa.dxrxtxax xtxlxoxsx xsxIxcxn
t-ehtr ex xhxnxix xoxkx,xax x xax
eAed danptns yenetxixg
vnr hop'e sah ro.hxnx
--- 8< ---- encoder test end -----

--- 8< ---- decoder -----
#!/usr/bin/perl -w
use strict;
use warnings;
my ($it,$ib);
while(defined($it=<>) and defined($ib=<>)) {
chomp($it); chomp($ib);
my ($lt,$lb)=(length($it),length($ib));
die("lengths not equal: '$it'=$lt '$ib'=$lb")if($lt!=$lb);
die("lengths not even: '$it'=$lt '$ib'=$lb")if($lt&1);
my @o=('','');
for my $o (0..1) {
for(my $i=0; $i<$lt; $i+=2) {
$o[$o^1].=substr($it,$i+$o,1).substr($ib,$i+$o,1);
}
$o[0]=~s/ ?x+$//; $o[1]=~s/ ?x+$//;
}
print("$o[0]\n$o[1]\n");
}
--- 8< ---- decoder test -----
echo "lFcrdtwo,econ you itelt fn
ook ohns af you sdinlioy
ttie aegtrxtxmxuxex xoxexcxyxt
hhs tlxo?ixhx xsxdxtx xnxrxpx
tFar eat apcrexim,tc t semr poienx
hot cxnra prodita eua doceyctdo x
a-t sa.dxrxtxax xtxlxoxsx xsxIxcxn
t-ehtr ex xhxnxix xoxkx,xax x xax
eAed danptns yenetxixg
vnr hop'e sah ro.hxnx " | perl r4d.pl
For those of you still on
lockdown, can you identify
the algorithm used to encrypt
this text?
For extra credit, cut some code
that can approximate a decryption
-- harder than it looks, as I can
attest.
And don't say nothing
ever happens here.
--- 8< ---- decoder test end -----

Note, the decoder uses my encoder output as its input, not Richard's
original.
0 new messages