- Transcript the key into numbers using the ASCII table.
- Convert the numbered key into a square matrix, the smallest possible size, and filling the lines first.
- Transcript the clear message into numbers using the ASCII table.
- Convert the numbered message into a matrix; its number of columns should fit the key matrix size. and its number of lines should be as small as possible.
- Multiply the 2 matrices, and write the answer linearly to get the encrypted message.
You have to execute the following command:
> ./103cipher message key flag
- message: [string] message to encrypt/decrypt
- key: [string] encryption key
- flag: [0, 1] -> 0 to encrypt, 1 to decrypt