# How does hill cipher key exchange takes place?

I am giving a presentation in my college where hill cipher is a part of the presentation. I just wanted to know, how is the hill cipher key matrix is exchanged securely in order to decrypt the message?

• You should be aware that the Hill cipher is unsafe for messages sizably larger than the key. – fgrieu Aug 17 '18 at 6:04
• @fgrieu how so? – Srijan Singh Aug 17 '18 at 6:25
• A guess of the plaintext the size of the key allows to find the key by solving a linear system of equations. That guess can be verified by deciphering later ciphertext and checking if it makes sense. That allows to break the Hill cipher much faster than trying all keys. Also, the usual 3x3 variant only has $2^{44.3\ldots}$ keys, making it vulnerable to brute force key search. – fgrieu Aug 17 '18 at 8:18

## 1 Answer

In the Hill cipher, like in any symmetric cipher, it is assumed that both parties have the same secret key already.

Securely exchanging a key is not part of the symmetric algorithm, neither is it its job. That a separate protocol that needs to be done beforehand.

• What is that protocol? If i am sending a message to person x using hill cipher how would I make sure that he has the same key? – Srijan Singh Aug 16 '18 at 18:05
• @SrijanSingh Use a standard key exchange protocol, using RSA, Diffie-Hellman or one of many other methods. You should also specify an encoding for a Hill-cipher key. The Hill-cipher does not specify it, nor does it have a key-exchange algorithm "built-in". – Henno Brandsma Aug 16 '18 at 18:07
• Okay, understood. Btw, how would you share the specified encoding? – Srijan Singh Aug 16 '18 at 18:21
• @SrijanSingh that depends on how you define the Hill cipher. It's not a standard. Do you use only lowercase letters, or bytes etc. etc. Use your imagination. – Henno Brandsma Aug 16 '18 at 18:30