The algorithm is a substitution cipher algorithm used to reduce the common number of occurences. This is done with the use of three rubiks cube (3x3x3) and each character is assigned a random cube which is chosen from a evenly distributed randomly generated sequence.
The key generation is done by creating a randomly generated and evenly distributed of length 100. The key performs the following 12 operations on the cube -
- Front & front prime
- Up & up prime
- Back & back prime
- Left & left prime
- Right & right prime
- Down & down prime
All the cubes are initialized with a default configuration. The cube looks as follows -
Following things can be noticed -
- The face 0 of the cube is the center most face. The next face is the one above it and then it goes in a clockwise manner.
- The characters 'X' after the digit '9' are the randomly generated characters.
- The ` character is a special character that is used for spaces.
-
Make sure you have at least c++11 compiler on your device.
-
Clone this repo.
git clone https://github.com/arp1561/Rubiks-Cube-Encryption
-
Navigate to the testing folder by
cd testing/
and compile the EncrptionTest.cpp program with the following command.g++ EncryptionTest.cpp ../src/Encryption.cpp ../src/Cube.cpp ../src/Generator.cpp ../src/Converter.cpp
for encryption. -
The input can be changed in the input folder.
-
After adding an input text, run the encryption using
./a.out
-
The ciphertext, asciivalues, keys can all be seen in the output folder.
-
Navigate to the testing folder and run the DecryptionTest.cpp program with the following command.
g++ DecryptionTest.cpp src/Encryption.cpp src/Cube.cpp src/Generator.cpp src/Converter.cpp
for Decryption.