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


Groups > sci.crypt > #50502

Re: Toy cipher I made for a reddit challenge

From Max <maxturv26@gmx.net>
Newsgroups sci.crypt
Subject Re: Toy cipher I made for a reddit challenge
Date 2021-10-19 00:47 +0200
Organization Aioe.org NNTP Server
Message-ID <skkthn$496$1@gioia.aioe.org> (permalink)
References (10 earlier) <sja0fp$1mr4$1@gioia.aioe.org> <sjc0ik$dqt$1@dont-email.me> <sjck63$np9$1@gioia.aioe.org> <skj5j4$s47$1@dont-email.me> <skkakj$nl2$1@dont-email.me>

Show all headers | View raw


On 18.10.21 19:24, wizzofozz wrote:
> Op 18-10-2021 om 08:52 schreef wizzofozz:
>> Op 3-10-2021 om 18:02 schreef Max:
>>> about Leo's hint. So, the correct sorting order is
>>>
>>> (right = 1, left = 0)
>>>
>>> b = 1  -> 1
>>> a = 0  -> 0
>>> b = 1  -> 0
>>> b = 1  -> 1
>>> y = 24 -> 0
>>> l = 11 -> 1
>>> e = 4  -> 1
>>> v = 21 -> 1
>>> e = 4  -> 1
>>> l = 11 -> 1
>>> s = 18 -> 0
>>> o = 14 -> 1
>>> e = 4 - > 0
>>> a = 0  -> 1
>>> s = 18 -> 0
>>> y = 24 -> 1
>>>
>>> I think, this we can take as certain. The remaining question is, how 
>>> do we get from the keyword to this bit-order, right?
>>>
>>>
>>> What information could the keyword/a letter in the keyword contain?
>>> 1. letter-value mod 2
>>
>> Did you notice that
>> [(ord(c)-ord('a'))%2 for c in 'babbylevelsoeasy']
>> [1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0]
>>
>> If you invert the bits, at least the number of 0/1 is correct. So that 
>> leaves us with the task to make sense of the ordering. Will look into 
>> that later.
> 
> So our inverted babbylevelsoeasy is 0100101010111111.
>  From that string we need to get to the order shown by Max.
> 
> We could try the mixing algorithm that is used to mix the alphabet. Leo 
> uses 13 as the 'middle' of 26. So I should now try 8 as the middle. 
> However that doesn't work out for me (but maybe I made mistakes).
> 
> If I use 7 (which should be 8 to keep in line with Leo) as the "middle", 
> I get this:
> 
> python bla5.py 1100110011000000
> start:  ['0', '1', '0', '0', '1', '0', '1', '0', '1', '0', '1', '1', 
> '1', '1', '1', '1']
> 1 0100101101111110
> 1 0100101011111101
> 0 0010010111111101
> 0 1001001011111101
> 1 1001001111111010
> 1 1001001111110101
> 0 1100100111110101
> 0 1110010011110101
> 1 1110010111101010
> 1 1110010111010101
> 0 1111001011010101
> 0 0111100111010101
> 0 1011110011010101
> 0 0101111011010101
> 0 0010111111010101
> 0 1001011111010101
> 
> So, if we use 1100110011000000 as the key for our shuffling algortihm we 
> get the desired key to shuffle the alphabet.
> Btw, I bruteforced that value (checking all 16 bit 'keys').
> It turns out there are more candidates (you can pick one that you think 
> Leo may have used (I picked the nicest looking one for the example above)).
> 
> Candidates:
> 
> 2107 k 0000100000111011
> 2443 k 0000100110001011
> 2499 k 0000100111000011
> 3595 k 0000111000001011
> 3651 k 0000111001000011
> 3843 k 0000111100000011
> 11905 k 0010111010000001
> 11906 k 0010111010000010
> 11920 k 0010111010010000
> 11968 k 0010111011000000
> 12811 k 0011001000001011
> 12867 k 0011001001000011
> 13059 k 0011001100000011
> 14977 k 0011101010000001
> 14978 k 0011101010000010
> 14992 k 0011101010010000
> 15040 k 0011101011000000
> 15489 k 0011110010000001
> 15490 k 0011110010000010
> 15504 k 0011110010010000
> 15552 k 0011110011000000
> 49675 k 1100001000001011
> 49731 k 1100001001000011
> 49923 k 1100001100000011
> 51841 k 1100101010000001
> 51842 k 1100101010000010
> 51856 k 1100101010010000
> 51904 k 1100101011000000
> 52353 k 1100110010000001
> 52354 k 1100110010000010
> 52368 k 1100110010010000
> 52416 k 1100110011000000
> 
> 
> code for bruteforce (just grep the output. it prints everything):
> 
> #!/usr/bin/python
> 
> 
> def round(c,al):
>          if c == '1':
>                  ral=al[:7]
>                  ral.extend(al[8:])
>                  ral.extend(al[7])
>          else:
>                  ral=[al[7]]
>                  ral.extend(al[:7])
>                  ral.extend(al[8:])
> 
>          return ral
> 
> for j in range(2**16):
>          k="".join([str(int((2**i&j)==(2**i))) for i in range(15,-1,-1)])
>          print j,'k',k
>          al=[c for c in "0100101010111111"]
> 
>          for c in k:
>                  al = round(c,al)
> 
>          print "".join(al)
> 
> 
> I think the code is correct because it has been derived from this:
> 
> 
> python bla1.py "1001011111010101"
>    ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 
> 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
> 1 ABCDEFGHIJKLMOPQRSTUVWXYZN
> 0 OABCDEFGHIJKLMPQRSTUVWXYZN
> 0 MOABCDEFGHIJKLPQRSTUVWXYZN
> 1 MOABCDEFGHIJKPQRSTUVWXYZNL
> 0 PMOABCDEFGHIJKQRSTUVWXYZNL
> 1 PMOABCDEFGHIJQRSTUVWXYZNLK
> 1 PMOABCDEFGHIJRSTUVWXYZNLKQ
> 1 PMOABCDEFGHIJSTUVWXYZNLKQR
> 1 PMOABCDEFGHIJTUVWXYZNLKQRS
> 1 PMOABCDEFGHIJUVWXYZNLKQRST
> 0 UPMOABCDEFGHIJVWXYZNLKQRST
> 1 UPMOABCDEFGHIVWXYZNLKQRSTJ
> 0 VUPMOABCDEFGHIWXYZNLKQRSTJ
> 1 VUPMOABCDEFGHWXYZNLKQRSTJI
> 0 WVUPMOABCDEFGHXYZNLKQRSTJI
> 1 WVUPMOABCDEFGXYZNLKQRSTJIH
> 
> ... which generates the correct output.
> 
> The code for the output above is here below (you can see that here the 
> 'middle' of 26 is 13):
> 
> 
> #!/usr/bin/python
> 
> import sys
> 
> k=sys.argv[1]
> 
> al=[c for c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
> 
> 
> def round(c,al):
>          if c == '1':
>                  ral=al[:13]
>                  ral.extend(al[14:])
>                  ral.extend(al[13])
>          else:
>                  ral=[al[13]]
>                  ral.extend(al[:13])
>                  ral.extend(al[14:])
> 
>          return ral
> 
> print ' ',al
> i=0
> for c in k:
>          al = round(c,al)
>          i+=1
>          print c,"".join(al)
> 
> 
> Ozz
> 
> 

These are indeed fascinating findings. I will take a deeper look on the 
weekend. But somehow, this feels wrong for a "babbylevel". It should be 
simpler.

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


Thread

Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-09-27 21:15 +0000
  Re: Toy cipher I made for a reddit challenge Richard Heathfield <rjh@cpax.org.uk> - 2021-09-27 23:12 +0100
    Re: Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-09-27 22:32 +0000
    Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-09-28 00:51 +0200
      Re: Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-09-28 04:04 -0500
        Re: Toy cipher I made for a reddit challenge Richard Heathfield <rjh@cpax.org.uk> - 2021-09-28 11:29 +0100
        Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-09-28 21:11 +0200
          Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-09-29 00:00 +0200
            Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-09-30 23:07 +0200
              Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-01 22:29 +0200
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-02 04:20 +0200
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-02 12:18 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-02 13:28 +0200
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-02 16:25 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-02 17:25 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-02 12:28 +0200
                Re: Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-10-02 10:42 -0500
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-02 18:13 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-03 12:27 +0200
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-03 18:02 +0200
                Re: Toy cipher I made for a reddit challenge Stefan Claas <spam.trap.usenet@gmail.com> - 2021-10-03 09:23 -0700
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-03 21:32 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-18 08:52 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-18 19:24 +0200
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-19 00:47 +0200
            Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-17 17:17 +0200
              Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-17 20:05 +0200
                Re: Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-10-25 17:18 -0500
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-26 20:03 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-27 19:49 +0200
                Re: Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-10-27 17:15 -0500
                Re: Toy cipher I made for a reddit challenge Max <maxturv26@gmx.net> - 2021-10-28 12:51 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-28 13:33 +0200
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-10-31 22:17 +0100
                Re: Toy cipher I made for a reddit challenge Richard Heathfield <rjh@cpax.org.uk> - 2021-10-31 22:38 +0000
                Re: Toy cipher I made for a reddit challenge Leo <usenet@gkbrk.com> - 2021-10-31 18:42 -0500
                Re: Toy cipher I made for a reddit challenge "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-10-31 19:30 -0700
                Re: Toy cipher I made for a reddit challenge wizzofozz <oxxxxxxxxxxxs@gmail.com> - 2021-11-01 21:40 +0100

csiph-web