Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Encrypting

Name: Anonymous 2010-10-04 0:20

What's your thoughts on encrypting multiplying characters four at a time by matrix then decrypting using A^(-1) as devision in the same fasion.

Obviously this is private key if the matrix is set up on opening of the program.

What you guys do? what next?

Name: Anonymous 2010-10-04 7:05

>>1
Other than the obvious problem, the encryption algorithm is easy to break using basic linear algebra.  It's easy to attack.

Here's a known plaintext attack:

Let x1, x2, ..., xn be the plaintext grouped in units of four characters, so x1 is the first four characters, etc.  Each xi is a four dimensional column vector.  The key is a four by four matrix, M.  The cipher text is Mx1, Mx2, ..., Mxn.

Suppose that the attacker knows the values of x1...x4, and suppose that these are linearly independent.  The attacker creates a matrix X whose columns are x1...x4 (the known plaintext), and a matrix Y whose columns are Mx1...Mx4 (the ciphertext).  Using simple Gauss-Jordan elimination it is possible to solve the equation MX = Y for M in O(N^3) time.

In practice, a known plaintext attack is the death knell for any algorithm, and most sets of four four-dimensional vectors are linearly independent -- making this attack very easy.  Your encryption is easy to break, if it even works at all.

And that's a good question... does it work at all?

And the obvious problem: The answer is no!  Why?  Because your scalar field has to actually be a field in order to work.  That is, using the integers 0 to 255 (or -128 to 127) you will end up with an encryption function that is not injective, i.e., that when you decrypt it, you will get multiple possible answers.  However, the fix is easy.  Just pick a finite field with 256 elements in it and you're good.  (Of course, it's just as easy to crack.)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List