Hey guys! Here is a guide to How to encrypt secret messages like Matrix: Part 4. Hope you have already seen other parts of this Cryptography series. So let’s get started!

The Matrix Encryption

Imagine in a dark raining night, someone has thrown a piece of paper that has following message.

“YEOIF STROR FSFWH TUEIH MEEQH TNOEE AZ” Key : 4 x 8 V ⬇⬇⬇⬇ L/R

You should have probably scratched your head! Because you don’t know how to decode it. To decode it, first of all, we have to understand the key before the message. Now the key is in the format like this:

Key : {Matrix Dim.} {Layout of Matrix} {Direction of Twisted Path} {Flow of path}

Making a Matrix

We know that a matrix consist of rows and columns and layout of a matrix can be either of three, horizontal(H), vertical(V), square(S). Now a 4 x 8 V matrix looks like this.

1234
2
3
4
5
6
7
8
4 x 8 Vertical Matrix

Direction of Twisted Path

Now comes the Direction of Twisted Path, which means the direction in which the code will be written in the matrix. It can be anything up (⬆), down (⬇), right (), left(⬅). There are 4 down arrows in which means that message has to be written in a downward direction in all four rows. And the flow of path tells, where we have to start writing the code. In the key, it’s written L/R which means Left-to-Right. It can also be Right-to-Left(R/L), Top-to-Bottom(T/B), Bottom-to-Top(B/T). Now if we write in a downward direction from left to right, our matrix will look like this.

YOUH
ERET
OFIN
ISHO
FFME
SWEE
THEA
RTQZ
4 x 8 Vertical Matrix

Now after this, it’s all our brain. Our key tells us how to write the message not to read it. We have to read the message in the direction from where it makes sense. If we read from the 1st column, left to right? Yes, it makes sense.

You here to finish off me, Sweetheart ?

The last two letters were Nulls. It could have make sense from last column, right to left but this was an easy one. Hence decoded.

And remember, in the vertical matrix, first-digit of the key is “no. of rows” and in the horizontal matrix, first-digit of the key is “no. of columns”.

Task-for-you!!

Decode the following message:

TLECBI NADZFH SRAAYH ETMNAW ERQRAI HVBAIO NMNEEE SIX

Key : 5 X 9 V ⬆ ⬇ ⬆ ⬇ ⬆ R/L

Hint : Jon Snow in Game of Thrones

Giveaway : First one to decode will get a Competitive Programming course by Coding Ninjas!
(Size – 19.40GB)

DECODE THIS IF YOU CAN!

Comment the decoded message!

Part 5 of this interesting cryptography for beginners’ guide will soon be posted on MathCompt. Stay tuned!

Reference : Break the Code: Cryptography for Beginners by Bud Johnson