Last week, Google CTF featured a crypto challenge based on the Rubik’s cube. Part of the challenge was to be able to visualize the cube associated to a list of colors, and identify which color was where on the cube. It took me some time to figure out the exact mapping between the list and the 3D structure, and now that the challenge is over I want to share a simple visualization that I made with three.js. Your browser must support WebGL to display it properly!

I also wrote a more complete write-up here.


Below is an interactive form where you can enter cube configurations, with the same serialization as in the challenge. A configuration consists of 54 colors (for the 54 squares of a Rubik’s cube), each of which must be in the set {W, R, G, B, O, Y} (for white, red, green, blue, orange and yellow).

Input must be 54 letters in the set {W, R, G, B, O, Y}

Rotation


Here are some examples of configurations obtained during the challenge.

  • The default solved cube
    WWWWWWWWWGGGRRRBBBOOOGGGRRRBBBOOOGGGRRRBBBOOOYYYYYYYYY
  • The default cube after permutation UU
    OOOOOOGGGGGRWWWOBBYYYGGRWWWOBBYYYGGRWWWOBBYYYBBBRRRRRR
  • The default cube after permutation LL
    WWWWWWOOOOOYGGGWRRBBBOOYGGGWRRBBBOOYGGGWRRBBBRRRYYYYYY
  • An example of challenger public key L1026U121L^{1026} \circ U^{121}
    ORBYOYYGGGGBROWOOYOBYRBGRYWGGYBWYBBRWWGROWROOBRYWRBWWG
  • An example of admin public key
    GWYROYBBRYGWROGYGBRROGBYBYYRGBWWWOOWRYOWRYBGWGOGWRBBOO

Comments

To react to this blog post please check the Twitter thread.


RSS | Mastodon | GitHub | Reddit | Twitter


You may also like

GoogleCTF 2017 - Rubik write-up
Making my website 10x smaller in 2024, with a dark mode
Detecting SIMD support on ARM with Android (and patching the Rust compiler for it)
Back online: lessons learned from recovering my website after a data center fire
And 29 more posts on this blog!