title: The Magic Cube Encryption
body: <p>I am trying to solve a very nice problem and I found a solution but this is more of like static solution.</p>
  <p>The problem.</p>
  <p>Cube has 8 corners, each containing one character. For example, the string
  “ABCDEFGH” would be represented on the cube like in the image below:</p>
  <p><a href="https://i.stack.imgur.com/NFlex.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NFlex.png" alt="enter image description here" /></a></p>
  <p>Cube can be rotated to the left, right, up and down.</p>
  <p>This rightwards rotation converted the initial string “ABCDEFGH” into
  “BFGCAEHD”.</p>
  <p>I want to know is there any algorithm or formula are there to find out changes in the corner? I did solve it by taking the notes of all changes of corners. For example, if A is in position 1 then if you change to right it will always replace it's position with E which is in position 5. So this is a very static solution. This solutions works because cube rotation is also static and never change position. However, want to know if this can be solved with a specific algorithm. Thank you :)</p>