Double Matrices Cipher (DC103)

Level: Easy

The solution can be designed as follows:

Step 1: Construct the second matrix as 16 \times 16 in size and fill the values from 0 to 255 from left-to-right (each row) top-to-bottom way.

Step 2: Create the key matrix as:

Construct another matrix of size 16 \times 16 and fill it with the key such that the key is repeated multiple times in sequential manner if necessary (keys are repeated if key size is less than 256) in order to fill the entire matrix (last repeated key may be partially used).

Step 3: Create the ciphertext matrix as:

Construct another 16 X 16 matrix. Fill the ciphertext characters one-by-one into the 16×16 matrix from left-to-right (each row) top-to-bottom way.

Step: Do XOR operation between 3 matrices (i.e. second-matrix XOR key-matrix XOR ciphertext matrix) and get the plaintext matrix. Read the plaintext values from it.