PDA

View Full Version : [DHTML] Matrix Encryptor



Trinithis
06-15-2007, 04:27 AM
1) CODE TITLE: Encryptor

2) AUTHOR NAME/NOTES: Trinithis

3) DESCRIPTION: Pumps out heavily encrypted text using matrices.

4) URL TO CODE: trinithis.awardspace.com/Encryptor/Encryptor.html

Seeing two recent encryptor type submissions made me want to batch this one out.

**Added: Unicode Buffer Value.**


You can make your own key. The key has customizable dimensions, and if you don't want to manually fill in your matrix, you can always randomize it, which happens automatically on page startup. To make your own, just type in the desired matrix size and hit "New Matrix". This creates an empty matrix. Also, you can customize any randomized values too. Only enter numbers into the matrix.

Once you have a likable key, just copy and save the value in "Matrix Key String". Next time you open the page, and you want to use your old key, clear the field and paste your copied value into it. Then hit the "Create Matrix From Text Field Button".

Keep any square brackets ('[') (']'), colons (':'), and commas in your key string and in your encrypted text.

The script automatically checks whether or not the matrix has bad values (such as letters) in it, and it checks to see if the matrix is singular or not when it performs certain actions. The user is prompted with appropriate dialogue.


How it works: Basically, the code uses math to encrypt your text using a square matrix of dim NxN, and it decodes it using that matrix's inverse. The text is converted to unicode and tossed into Nx1 matrices, where N is the size of the key. Then it multiplies them together to get your encrypted text. The process is repeated until all the text is translated into 1 or more matrices. The decryption is similar, except the encrypted matrices are multiplied by the key's inverse. As long as your matrix is of adequate size and contains decently sized values, your encryption is virtually undecipherable without a key or sample text. (Such as something like an 8x8 matrix with vals from -100 to 100. Not to mention 20x20 matrices with vals from -100000 to 100000) Yay! Math is fun!

djr33
06-15-2007, 05:15 AM
Pretty cool and you put a lot of work into it, plus some cool logic/math, but the result is the same as any other encryption... you supply the decoder with it.
(Note the spelling error 'deciper'.)

Trinithis
06-15-2007, 05:24 AM
You could always manually decode the encryption if you know how to work matrices and unicode :) (InverseOfMatrixKey*EachEncryptedMatrix yields unicode representation of the string.)

Perhaps I should display the inverse matrix in table form and string form.

BTW I couldn't see a "deciper" spelling error.
[*Found it and fixed*]

djr33
06-15-2007, 05:31 AM
Well, sure, but at that point, it's of little use on a webpage. Plus, you'd still need to make the key available, automatically or not.

Check the button at the bottom for the spelling.

Twey
06-15-2007, 09:13 AM
the result is the same as any other encryption... you supply the decoder with it.But not the key, which is also necessary to decrypt any given piece of text. This is true encryption, although probably not very strong.
Well, sure, but at that point, it's of little use on a webpage.Who said it was meant to be used for a web page? It's just a generic encryptor.
Plus, you'd still need to make the key available, automatically or not.Only to those who should read it, and that's how cryptography works.

djr33
06-15-2007, 09:13 PM
Theoretically that may make sense. But if so, it doesn't fit in this forum. This is for submitting scripts for the web. How is that applicable?

Or, I guess, this is intended to be a thing on a page to create encrypted text, then you can send secret messages to friends or something?

this isn't meant for source code, I guess.