Forum

Re: Challenge  

  By: Anita on Nov. 30, 2016, 10:11 p.m.

Halli Hallo

Viellicht kann mir jemand helfen bei dieser Challenge. Habe die Buchstaben genau wie im Beispiel geordnet, raus kommt aber nichts sinnvolles. [HTML_REMOVED]

Grüsse Anita

Hi

Can anybody help me with this challenge? I rearranged the letters like in the example but there is only nonsense [HTML_REMOVED]

Greetings Anita

Hi there Anita.

To help you understand how this challenge works try encoding and decoding a sentence of your own.

I hope that will help you understand how the cipher works if not PM me for an extra hint.

Yeah finally I found it. I didn't know what's wrong with my brain [HTML_REMOVED] I did not look good enough on the example, especially how to DEcrypt :) A own sentence give me the "Aha"-effect!

Re: Challenge  

  By: markf on Jan. 11, 2017, 11:21 p.m.

I particularly enjoyed this example. As with all of them I'm doing TDD groovy applications to solve them.

I analysed the patterns being produced and found an interesting way to generate the order in which to place chars to encrypt. Decrypting is similar.

For the simple case, 2 letters (n=2), it's simply the order [1,2], or o = 1.2 from now on.
Looking at more letters:
n=2, o=1.2
n=3, o=1.3.2
n=4, o=1.3.2.4
n=5, o=1.5.3.2.4
and so on.

It's obvious as you go down the list that the order is never jumbled up, a new number is insert somewhere into the previous order. This is important because we can remove entries from the list, and get back to previous list orders.

The important parts are at powers of 2, where the tree expands fully into every node having 2 letters.
n=2, o=1 .2 n=4, o=1 .3 .2 .4 n=8, o=1.5.3.7.2.6.4.8In fact we see that to form the next power of 2, we start by 'dropping down' the previous list and inserting numbers between them.

So, looking back at n=8:
o= 1.A.3.B.2.C.4.D
The entries ABCD are the next 4 numbers to be insert (5,6,7,8), but in what order?

The numbers are fascinatingly enough simply the current list with each entry incremented by the list size i.e. 1.3.2.4 + 4 for each.
so A,B,C,D are in order 5,7,6,8

And so the order for n=8 is 1.3.2.4 + 5.7.6.8 interleaved to give 1.5.3.7.2.6.4.8

This pattern repeats at every power of 2.

n=16, o=[1.5.3.7.2.6.4.8] + [9.13.11.15.10.14.12.16] interleaved = [1.9.5.13.3.11.7.15.2.10.6.14.4.12.8.16]

To work out the cipher for a 6 letter word, simply find the order for the next power of 2 (i.e. n=8), and remove any entries larger than the plaintext size. In 6 letter case, 1.5.3.2.6.4 (7 and 8 are removed) because as we noted earlier, you can remove entries from the list as numbers never 'swap' around.

In pseudo code:
encrypt(text) { order = [1,2] exp = [HTML_REMOVED] i = 1 while (i < exp) { nextList = [HTML_REMOVED] order = [HTML_REMOVED] i++ } // remove entries above the size of the plaintext reducedOrder = order.findAll{ it <= text.size() } cipher = [HTML_REMOVED] return cipher }One additional fact I noted is that for plaintexts whose lengths are exactly a power of 2, encryption and decryption are reverse functions, i.e. encrypting the ciphertext gives the plaintext. This is because the tree is perfectly balanced and you are undoing the previous operation.

For decryption otherwise, I formed the same order as in the above algorithm, mapped these to an index, and then picked the characters from the ciphertext in the order given, e.g.
`cipher = 'mfrak' order = [1.5.3.2.4] map = [1:1, 5:2, 3:3: 2:4, 4:5] plain = cipher[map[1]=1 -> m] + cipher[map[2]=4 -> a] + cipher[map[3]=3 -> r]

  • cipher[map[4]=5 -> k] + cipher[map[5]=2 -> f] == 'markf'`

Re: Challenge  

  By: 100tick on July 1, 2019, 3:54 p.m.

Ok. I really don't know how you guys did it. But I did it manually. Would like to create a program to do this for me. Is anyone interested???

Re: Challenge  

  By: ker2x on Dec. 13, 2020, 6:35 p.m.

I'm really confused about something here.
I "solved it", but the end result was still partially mixed and i had to guess.

Example :

0123456789
02468 13579
048 26 159 37
04 8 2 6 19 5 3 7

therefore : 0482619537

How, from 0482619537 am i supposed to know it is :
04 8 2 6 19 5 3 7
and not
04 23 61 9 53 7
or
04 8 26 1 95 37

There is probably an hidden rule but i can't find it

Re: Challenge  

  By: itnomad on Jan. 9, 2021, 1:47 p.m.

Hello everyone,

I'm new here and I just solved this challenge programmatically. Yes, you can determine the permutation for plaintexts of arbitrary lengths. I developed an algorithm to determine the permutation for a sequence of given length, though it runs recursively, so for very long messages runtime and memory become an issue.

The list of permutations are the index of the plaintext string (starting at 0, so watch for off-by-ones) and where it has to be put in the ciphertext string, e.g.

`>>> plaintext='CRYPTO'

getbeaverpermutation(len(plaintext)) [0, 4, 2, 1, 5, 3] list(deepflatten(beaver_enc(plaintext))) ['C', 'T', 'Y', 'R', 'O', 'P']`
I'm not sure if I may share the code here, as it might be considered to be a spoiler. But if someone wants the code I'd be happy to share it offline (if that is acceptable & the requestor can show me the solution :-) )

Actually I'm interested if someone cooked up an iterative solution to this permutation? If yes, I'm really interested in having a look at it.

Oh, by the way, not sure if anyone noticed, but the permutation follows an OEIS sequence and has some nice applications elsewhere :-)

Other than that, happy to have found this site by accident! I knew about CrypTool for years, I'm reading Klaus Schmeh's and Dirk Rijmenants' blogs, solve challenges elsewhere, so yeah - my weekends are saved during the lockdown :-)

All the best & stay healthy,
Alex.


Currently 20 guests and 0 members are online.
Powered by the CrypTool project
Contact | Privacy | Imprint
© 2009-2024 MysteryTwister team