cubecrypt

A "toy" cipher using a Rubik's Cube. Not secure by modern standards, but much more secure than "typical" hand-ciphers like Vigenère. Effective key size is approximately 60 bits. Don't use this for anything that needs real encryption.
Alphabet: A-Z skipping J and V. Input is normalized by removing spaces and mapping J->I and V->U.

cubecrypt Algorithm

The key is first encrypted and discarded. This keyed setup leaves the cube in a secret internal state shared by anyone who knows the key.

For each message letter, the cube is reoriented so that the plaintext edge sticker moves into the top-right UB position. The matching corner sticker at URB is read as the ciphertext letter.

The cube state is then advanced by applying the 5-move U R F L U, reorienting the ciphertext edge back into UB, and applying the 6-move U R F L U R. Decryption follows the same state evolution in reverse logic.

After running encryption or decryption, the animated cube view and detailed trace explain each state transition step by step.

Cube View

Solved starting state
1 / 1

cubecrypt Design

cubecrypt is best thought of as a toy, stateful hand cipher built around a Rubik's Cube. It behaves like a finite-state machine whose current cube state determines the next substitution, rather than like a fixed monoalphabetic or polyalphabetic table.

Historically, it has more in common with rotor machines (like Enigma) and autokey-style systems than with modern stream ciphers. The substitution changes every letter, and the state update is driven in part by the symbol just produced. In that sense it uses cipher feedback as an autokeying mechanism: the emitted ciphertext helps determine how the cube is reoriented before the next scrambling step.

It is also stream-cipher-like in that it processes one symbol at a time and requires sender and receiver to stay in lockstep. The state update is highly non-linear and geometric because each symbol causes a whole-cube reorientation followed by two different fixed move sequences: U R F L U and then U R F L U R.

The choice of the 5-move U R F L U is deliberate: it separates 20 of the 24 edge-corner pairings in a single application, which gives strong state diffusion for such a short move sequence. The follow-up 6-moveU R F L U R separates 22 of the 24 while keeping the procedure compact and memorable.

Group-theoretically, the orientation moves together with these sequences generate the full cube-state. Because U R F L U is odd while U R F L U R is even, the full character step toggles cube-state permutation parity. That means even key lengths land in even permutations, odd key lengths land in odd permutations, and over time the cipher can reach the full cube state space rather than only one parity class.

This structure makes cubecrypt interesting to study and play with, but not suitable for real security. It lacks the design proofs, diffusion guarantees, and the cryptanalytic scrutiny behind modern ciphers. Its value is mainly educational: it shows how substitution, internal state, feedback, permutation groups, and synchronization can be combined into a coherent hand-operated cipher machine.