Mathematics question: determining size of key space of encryption cipher

I'm trying to figure out how many bits are the keys generated from a 3x3 or a 4x4 or a 5x5 HILL CIPHER. I know that a 5x5 matrix modulo 26 is about 114 bits. But what if you extended the modulus to 256? Would you be able to get 128 bits of encryption with just a 3x3 or a 4x4 hill cipher?
That gives the formula for modulus 26. I'm trying to find the formula for modulus 256.
The only thing that I can understand from explanation is: 4.64*n^2-1.7.
Read the part of the article on decryption.

If you are choosing mod 256, then there are 256n×n matrices of dimension n × n. Thus the upper bound on your key size is log2( 256n×n ) which is 8n2.

For a 3×3 matrix, that's 72 bits (maximum).
For a 4×4 matrix, that's 128 bits (maximum).

Just make sure you choose an invertable matrix. Good luck!

[edit] Added note to remember that this is the upper bound -- you may not need as many bits for your particular matrix key...
Last edited on
Topic archived. No new replies allowed.