3
$\begingroup$

I’ve been exploring a theoretical encryption method inspired by a 3×3 Rubik’s Cube.

Conceptually, it works like this:

  1. The plaintext is written onto the cube’s faces in some systematic order. For example, letters could be placed row by row across the cube’s surfaces. If the message doesn’t fill the cube, extra random letters can be added as padding.

  2. A sequence of moves is then applied to the cube, permuting the positions of the letters. The sequence of moves is logged and acts as the key for decryption.

To decrypt, the moves are applied in reverse, and the letters are read off in the original systematic order to recover the plaintext.

This approach is essentially a permutation-based cipher, where the cube’s states represent different permutations of the letters. Random padding is used to obscure the length and structure of the message.For a 3×3 cube, there are over 43 quintillion possible states, so the system relies on large permutations to provide a theoretical keyspace.


I’m interested in the general cryptographic properties of this type of system.

Specifically:

  1. What weaknesses exist in permutation-based encryption systems like this?
  2. How does adding random padding affect security?
  3. Are there general considerations or pitfalls when using combinatorial or mechanical devices (like a cube) to permute letters in encryption?

I’m not asking for a security audit of a full personal design, just a discussion of theoretical properties that would apply to any system using letter permutations and move sequences like this.

$\endgroup$
3
  • $\begingroup$ crypto.meta.stackexchange.com/questions/1481/… $\endgroup$ Commented Aug 27 at 12:59
  • $\begingroup$ It's unclear how many letters per cube there is. Some general considerations that come to mind: If you send the name of a person on the public class roll in this way, chances are it's trivial to narrow down on which, merely by checking which characters are used. (in)security will also depend enormously on if the key is reused or not. If it's not, the system is only useful if keys are transmitted in advance, and then there is the operational problem of matching a ciphertext with it's key. $\endgroup$ Commented Aug 29 at 10:21
  • 2
    $\begingroup$ This is a 54-character transposition cipher, considerably restricted because not all permutations are generated by Rubik's cube moves from the standard initial state: center faces are never exchanged with edges, nor edges with corners, and there are twelve disjoint orbits. As @fgrieu noted, this leaks the set of characters used. Padding should be done, if at all, only with authentication to avoid padding oracle attacks. $\endgroup$ Commented Aug 30 at 1:58

1 Answer 1

1
$\begingroup$

I'll try to comprehensively answer most aspects of a Rubik's cube cipher. We'll assume for the purpose of this question, automated cryptanalysis, such as by a computer is ineligible to compete.

First, as mentioned by @HighwayEngineer, this is in fact a considerably restricted transposition cipher. A transposition a function that maps an element which is a sequence, to a sequence of same size. This forms a permutation. In an ideal transposition cipher, all permutations should be possible, but in reality, all efficiently computable permutation don't cover all possibilities, yet a Rubik's cube permutation is even more restricted:

center faces are never exchanged with edges, nor edges with corners, and there are twelve disjoint orbits.

Second, as with all transposition ciphers, all letters have the same frequency as would be with actual English (or French, Spanish, etc.) What's worse for ideogram-based languages such as Chinese, is that with a 54-character message, one could practically guess the plaintext without actually decrypting it. Esciapelly coinseridng the order of the letters doesn't aeffct rediang. (This mis-spelling of words are intentional and for illustrative purposes, please do not fix)

Third, probably the least obvious, is that the orientation of the letters on the cube can be used as a hint, and make it possible to guess and recover the original setup of the cube. For example, you wrote all the letters with one side facing up on one side, the letters will be upright in one way or another after moves applied to the cube.

The ultimate recommendation for enhancement is of course to use a secure cipher, but that recommendation is ineligible to compete under the premise of this question. The next option is to use "paddings", which can consist of a subset of the following:

  1. substitution of letters, with subsequent substitution be influenced by previous states. For ideogram-based languages, individual radicals may be substituted, and character structure changed (e.g. left-right to up-down).

  2. simple pre-transposition, to remove fixed points on the cube. Although simple in its own regard, remember that some modern ciphers are made up of multiple rounds of simple steps.

  3. rotate the letters before writing onto the cube.

  4. addition of checksum. Beware that some checksum algorithm are ineffective on some ciphers, e.g. CRCs on stream ciphers are linear-malleable, and is in fact no protection at all.

$\endgroup$
6
  • $\begingroup$ This is a bizarre use of the word “padding”. In this context, of a block cipher, padding would usually refer to adding a suffix to a <54-character input to bring it up to exactly 54 characters so that the original string—and in particular the original length—can be recovered exactly, such as adding $n$ bytes with the byte value $n$ to a $(54 - n)$-byte string for $n \geq 1$, as in PKCS#5 padding. None of the options do this. A checksum would be particularly weird instead of an authenticator on the ciphertext. $\endgroup$ Commented Sep 1 at 1:38
  • $\begingroup$ @HighwayEngineer My English vocabulary is limited in this regard. Anyone with better wording are free to edit! $\endgroup$ Commented Sep 1 at 2:01
  • $\begingroup$ I really appreciate your answer to my question, but I have a follow up! How much would it increase security if we used a 5x5 or even 6x6 cube and we put more random padding letters than plaintext letters. So we would take the cube and put on our plaintext so it covers less than 50% of the cube and the rest can be filled with random filler letters so after the scramble we just read the ciphertext off in the same way we wrote on the plaintext and thats the ciphertext. That would highly reduce the effectiveness of frequency analysis because of the extra letters. And would also hide the lenght. $\endgroup$ Commented Sep 7 at 20:26
  • $\begingroup$ @TheCryptoStar S1: Using a larger cube would increase the security at most by amount of freedom in the choice of permutation we have. S2: We assume for now the random filling could be generated independently and not transmitted, since the moves of the cube is what constitutes the cipher key - even in this case, frequency analysis would identify meaningful letters unless the filling is not uniformly random, and imitates and misguides the true distribution of the plaintext (ignoring ideograms for now). It does hide the length though. $\endgroup$ Commented Sep 7 at 23:34
  • $\begingroup$ I mean of course we cannot compare this to a modern cipher and should not be used for real security but i think its actually fairly secure as a classical cipher might even be more secure than enigma $\endgroup$ Commented Sep 13 at 15:17

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.