Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.crypt > #50115

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

From wizzofozz <oxxxxxxxxxxxs@gmail.com>
Newsgroups sci.crypt
Subject Re: CHATX - a thread starter that's not as easy as it looks.
Date 2021-09-25 13:29 +0200
Organization A noiseless patient Spider
Message-ID <sin17b$n7$1@dont-email.me> (permalink)
References <si9jk4$188$1@dont-email.me> <siakbv$j80$1@gioia.aioe.org> <siakmd$ilv$1@dont-email.me> <87czp2do4k.fsf@zotaspaz.fatphil.org>

Show all headers | View raw


Op 21-9-2021 om 16:00 schreef Phil Carmody:
> Richard Heathfield <rjh@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.

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












Back to sci.crypt | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-20 10:17 +0100
  Re: CHATX - a thread starter that's not as easy as it looks. MM <mrvmurray@gmail.com> - 2021-09-20 07:00 -0700
    Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-20 15:17 +0100
      Re: CHATX - a thread starter that's not as easy as it looks. MM <mrvmurray@gmail.com> - 2021-09-20 10:52 -0700
        Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-20 19:10 +0100
  Re: CHATX - a thread starter that's not as easy as it looks. Max <maxturv26@gmx.net> - 2021-09-20 20:36 +0200
    Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-20 19:42 +0100
      Re: CHATX - a thread starter that's not as easy as it looks. Max <maxturv26@gmx.net> - 2021-09-20 20:50 +0200
        Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-20 21:02 +0100
          Re: CHATX - a thread starter that's not as easy as it looks. Max <maxturv26@gmx.net> - 2021-09-20 22:24 +0200
            Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-20 22:08 +0100
      Re: CHATX - a thread starter that's not as easy as it looks. wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-09-20 21:43 +0200
        Re: CHATX - a thread starter that's not as easy as it looks. Max <maxturv26@gmx.net> - 2021-09-20 21:50 +0200
      Re: CHATX - a thread starter that's not as easy as it looks. Phil Carmody <pc+usenet@asdf.org> - 2021-09-21 17:00 +0300
        Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-21 15:22 +0100
        Re: CHATX - a thread starter that's not as easy as it looks. Max <maxturv26@gmx.net> - 2021-09-21 23:31 +0200
          Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-21 23:03 +0100
            Re: CHATX - a thread starter that's not as easy as it looks. Max <maxturv26@gmx.net> - 2021-09-22 00:22 +0200
        Re: CHATX - a thread starter that's not as easy as it looks. wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-09-25 13:29 +0200
          Re: CHATX - a thread starter that's not as easy as it looks. Phil Carmody <pc+usenet@asdf.org> - 2021-09-26 14:39 +0300
  Re: CHATX - a thread starter that's not as easy as it looks. Richard Harnden <richard.nospam@gmail.com> - 2021-09-21 15:07 +0100
    Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-21 15:18 +0100
      Re: CHATX - a thread starter that's not as easy as it looks. Phil Carmody <pc+usenet@asdf.org> - 2021-09-21 21:43 +0300
        Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-21 20:41 +0100
  Re: CHATX - a thread starter that's not as easy as it looks. wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-09-25 02:24 +0200
    Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-25 05:24 +0100
  Re: CHATX - a thread starter that's not as easy as it looks. Richard Harnden <richard.nospam@gmail.com> - 2021-09-25 13:56 +0100
    Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-25 14:21 +0100
      Re: CHATX - a thread starter that's not as easy as it looks. Richard Heathfield <rjh@cpax.org.uk> - 2021-09-25 14:28 +0100
    Re: CHATX - a thread starter that's not as easy as it looks. wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-09-25 16:11 +0200

csiph-web