Welcome Guest [Log In] [Register]
Viewing Single Post From: My New Cipher
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
Paarth Dave
Apr 15 2008, 10:24 PM
What do you mean by vectors and matrix multiplication? It would be very appreciable if you show this method by an example.

A matrix is a two-dimensional array of numbers, a vector is a one-dimensional sequence of numbers. The multiplication of a vector by a matrix yields another vector.

Suppose our plaintext is "SEND HELP", and our key is the 2x2 matrix:
Code:
 
[  3  5 ]
[  7 11 ]
We take the plaintext two letters at a time, treating each letter as an integer mod-26:
Code:
 
"S" = 18, E" = 4 :
[ 18 ]
[  4 ]
We multiply the matrix and the vector:
Code:
 

[  3  5 ] * [ 18 ] = [  3 * 18 +  5 *  4 ] = [  2 + 20 ] = [ 22 ]
[  7 11 ]   [  4 ]   [  7 * 18 + 11 *  4 ]   [ 22 + 18 ]   [ 14 ]
And since 22 = "W" and 14 = "O", we thus encode "SE" as "WO". We do the same process for the remaining pairs of plaintext letters, adding a random padding character at the end if we're one short.

To decrypt, we multiply by a matrix that is the inverse of the one we used to encrypt. Not all matrices can be inverted - we can only use invertible matrices as keys.
When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post
My New Cipher · Challenges