User:Ishan mehta/N-byte symmetric key N-level encryption

Summary
This article describes an algorithm to encrypt data using a N-byte symmetric key. It is not based on any well-known algorithms.

Initialization
First we need to take a constant:

"" This constant can be different for different implementations.

We also need to take a few variables:

"" _encLevel and _encKey can have any value set by implementation, or in case of a library, a public setter can also be provided so its value can be changed at runtime.

_encLevel defines how many times a string will be encrypted over and over again. More value of _encLevel means it would be more complicated to decrypt the encrypted string without the key. Whenever value of the _encKey is changed, the _encKeyTotal should be recalculated as per the following logic:

"" A typical value of the Character.MAX_VALUE would be 65535 (supporting unicode characters).

Encryption
is a parameter passed to the encrypt subroutine.

Now, initialize a few variables,

"" Now, run a loop for _encLevel times. This will keep on encrypting the string (first time the input string and then the encrypted string) number of times to make it more and more secure. ""

Decryption
Decryption also works in the similar way. It processes the encrypted string in the reverse order (i.e. from last character to the first character).

Consider  as the subroutine parameter having previously encrypted string using the same key and same encryption level.

""

Performance
The algorithm is pretty optimized. The performance depends on the length of the string to be encrypted and the encryption level. The key also makes a difference, but not much.

Java implementation of this algorithm and taking into consideration the string "My name is Ishan" and with low encryption levels (upto 2000) it hardly takes 10 milliseconds. With encryption level of 100,000 also it takes only 70 milliseconds to encrypt / decrypt. Normally, decryption takes slightly more time as compared to encryption. This was tested on a Virtual Machine installed on a Core2Duo E4500 CPU @ 2.2GHz with 2 GB RAM - Windows Vista Home Basic (allocated 1GB to the guest OS - Windows XP SP2).

Examples
Following are some example encryptions generated using this algorithm:

Example 1
Source String = "My name is Ishan"

Key = "Ishan"

Encryption Level = 10

Encrypted String (series of unicode hex characters) =

""

Example 2
Source String = "My name is Ishan"

Key = "Ishan"

Encryption Level = 15

Encrypted String (series of unicode hex characters) =

""

Just by changing the encryption level from 10 to 15 makes the encrypted string totally different.

Example 3
Source String = "My name is Ishan"

Key = "Ishan1"

Encryption Level = 15

Encrypted String (series of unicode hex characters) =

""

Just by adding a single character at the end of the key, but keeping the encryption level the same also makes a huge difference in the final encrypted string.

This makes this algorithm highly difficult to break.

Example 4
Source String = "My name is Ishan"

Key = "Ishan1"

Encryption Level = 100000

Encrypted String (series of unicode hex characters) =

""

Time taken to encrypt = approx 70 mSec

Time taken to decrypt = approx 70 mSec

Some stuff for Crackers
Here are some example encrypted strings. Try to extract the original string out of this. The strings are provided in the form of series of unicode hex characters.

Example 1
""

Example 2
""