Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Max <maxturv26@gmx.net> |
|---|---|
| Newsgroups | sci.crypt |
| Subject | Re: Toy cipher I made for a reddit challenge |
| Date | 2021-10-02 16:25 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <sj9q5b$lc3$1@gioia.aioe.org> (permalink) |
| References | (6 earlier) <sj58uc$nlj$1@dont-email.me> <sj7r3v$avt$1@dont-email.me> <sj8fl6$b86$1@gioia.aioe.org> <sj9bli$1ui7$1@gioia.aioe.org> <sj9fo1$9dd$1@dont-email.me> |
On 02.10.21 13:28, wizzofozz wrote:
> Op 2-10-2021 om 12:18 schreef Max:
>
>>
>> Ok. This isn't the only possible order in which to sort the letters.
>> Some steps are forced, but not all. E.g., for the 3rd b one could
>> either move the L to the right or the P to the left. This creates a
>> tree. Have to dig into this later.
>>
>
> I just tested with an implementation which uses a "left list" and "right
> list". I think this slightly different
I like this thinking.
>
> Some code:
>
Nice. I hope you are no Python purist, as I slaughtered your code and
hacked it into this abomination. It doesn't take any arguments.
----------------------------------
#!/usr/bin/python
import sys
solString = "WVUPMOABCDEFGXYZNLKQRSTJIH"
keyLength=16
sol=[c for c in solString]
al=[c for c in "ABCDEFGHIJKLM"]
ar=[c for c in "NOPQRSTUVWXYZ"]
#Run a recursion over all steps of the algorithm that might lead to the
correct solution
def possibleSteps(key, al, ar, ctr):
if (ctr < keyLength):
for i1 in range(0,2):
for i2 in range(0,2):
(bl, br) = round(i1, i2, al, ar)
if (
("".join(sol).find("".join(bl)[:2]) != -1) and
("".join(sol).find("".join(br)[-2:]) != -1) ):
possibleSteps(key + str(i1) +
str(i2), bl, br, ctr+1)
else:
if (("".join(al)+"".join(ar)) == "".join(sol)):
print key #key in binary
#Make key into 4 readable letters
key2=""
while (len(key) > 0):
if (key[:2] == "00"):
key2 = key2 + "a"
elif (key[:2] == "01"):
key2 = key2 + "b"
elif (key[:2] == "10"):
key2 = key2 + "c"
elif (key[:2] == "11"):
key2 = key2 + "d"
key=key[2:]
print key2
return
def round(n1, n2, al, ar):
cl = al[:]
cr = ar[:]
if n1%2 == 0:
ta=cl.pop() # take from left list
else:
ta=cr[0] # take from right list
cr=cr[1:]
#if (n/2)%2 == j:
if n2%2 == 1:
cr.append(ta) # append to right list
else:
cl.insert(0,ta) # insert in left list
return (cl,cr)
print solString
print
possibleSteps("", al, ar, 0)
-------------------------------------
Yet, this gives us all possible combinations that would result in the
final cipher, being:
11100001011011111111010101101010
11100001011011111111010110011010
11100001011011111111010110100110
11100001011011111111010110101001
11100001011011111111011001011010
11100001011011111111011001100110
11100001011011111111011001101001
11100001011011111111011010010110
11100001011011111111011010011001
11100001011011111111011010100101
11100001011011111111100101011010
11100001011011111111100101100110
11100001011011111111100101101001
11100001011011111111100110010110
11100001011011111111100110011001
11100001011011111111100110100101
11100001011011111111101001010110
11100001011011111111101001011001
11100001011011111111101001100101
11100001011011111111101010010101
11100001100111111111010101101010
11100001100111111111010110011010
11100001100111111111010110100110
11100001100111111111010110101001
11100001100111111111011001011010
11100001100111111111011001100110
11100001100111111111011001101001
11100001100111111111011010010110
11100001100111111111011010011001
11100001100111111111011010100101
11100001100111111111100101011010
11100001100111111111100101100110
11100001100111111111100101101001
11100001100111111111100110010110
11100001100111111111100110011001
11100001100111111111100110100101
11100001100111111111101001010110
11100001100111111111101001011001
11100001100111111111101001100101
11100001100111111111101010010101
11100010010111111111010101101010
11100010010111111111010110011010
11100010010111111111010110100110
11100010010111111111010110101001
11100010010111111111011001011010
11100010010111111111011001100110
11100010010111111111011001101001
11100010010111111111011010010110
11100010010111111111011010011001
11100010010111111111011010100101
11100010010111111111100101011010
11100010010111111111100101100110
11100010010111111111100101101001
11100010010111111111100110010110
11100010010111111111100110011001
11100010010111111111100110100101
11100010010111111111101001010110
11100010010111111111101001011001
11100010010111111111101001100101
11100010010111111111101010010101
or, for readability, condensed to a 4-letter alphabet
dcabbcddddbbbccc
dcabbcddddbbcbcc
dcabbcddddbbccbc
dcabbcddddbbcccb
dcabbcddddbcbbcc
dcabbcddddbcbcbc
dcabbcddddbcbccb
dcabbcddddbccbbc
dcabbcddddbccbcb
dcabbcddddbcccbb
dcabbcddddcbbbcc
dcabbcddddcbbcbc
dcabbcddddcbbccb
dcabbcddddcbcbbc
dcabbcddddcbcbcb
dcabbcddddcbccbb
dcabbcddddccbbbc
dcabbcddddccbbcb
dcabbcddddccbcbb
dcabbcddddcccbbb
dcabcbddddbbbccc
dcabcbddddbbcbcc
dcabcbddddbbccbc
dcabcbddddbbcccb
dcabcbddddbcbbcc
dcabcbddddbcbcbc
dcabcbddddbcbccb
dcabcbddddbccbbc
dcabcbddddbccbcb
dcabcbddddbcccbb
dcabcbddddcbbbcc
dcabcbddddcbbcbc
dcabcbddddcbbccb
dcabcbddddcbcbbc
dcabcbddddcbcbcb
dcabcbddddcbccbb
dcabcbddddccbbbc
dcabcbddddccbbcb
dcabcbddddccbcbb
dcabcbddddcccbbb
dcacbbddddbbbccc
dcacbbddddbbcbcc
dcacbbddddbbccbc
dcacbbddddbbcccb
dcacbbddddbcbbcc
dcacbbddddbcbcbc
dcacbbddddbcbccb
dcacbbddddbccbbc
dcacbbddddbccbcb
dcacbbddddbcccbb
dcacbbddddcbbbcc
dcacbbddddcbbcbc
dcacbbddddcbbccb
dcacbbddddcbcbbc
dcacbbddddcbcbcb
dcacbbddddcbccbb
dcacbbddddccbbbc
dcacbbddddccbbcb
dcacbbddddccbcbb
dcacbbddddcccbbb
Now, we just have to sieve the one that reeks of "babbylevelsoeasy"...
Back to sci.crypt | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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