| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | ||
| 1 | s | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | |
| 2 | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | |
| 3 | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | |
| 4 | r | s | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | |
| 5 | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | |
| 6 | t | u | v | w | x | y | z | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | ! | , | . | : | ; | ? | ~ | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | - | = | ] | [ | } | { | / | > | < | " | ' | ` | | | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s |
Encrypted string United States of America would be !? /9%Lw$?^^/';%'t-9@*7@.
Explanation:The password ("secret" in this case) is the first column on the left, right after the numbers. The numbers are there to help you remember where you are at.
Say you are trying to encrypt the phrase "United States of America". The first letter is U (a CAPITAL U, this is important). To find the new letter, you go to line 1 (because this is the first letter of the phrase). Go to the U at the top, and match it with the letter under the U on line 1. This is an exclamation point (!).
For the second letter, n (a SMALL n, this is important), you match the letter under the small n on the top line with the letter on line 2. In this case, the question mark (?) character. Rinse, repeat. When you come to the end of the password, go back up to the top.
Notice where the alphabet starts for each line... Line 1 starts at s, line 2 at e, etc.
You can see how it could be difficult to crack. Not impossible, but difficult. If your aim is to confuse people playing games on your site or to pass some data in hidden form fields, this class is perfect. If your server has PHP with mhash() or mcrypt() functions, use those. If it doesn't, as most don't, try this!
To decrypt, just do the reverse. Take the exclamation point (!), the first character in the encrypted string, and match it on Line 1. Follow it to the top and you have the original letter.
This is a form of a substitution encryption, which isn't very sophisticated. However, this does more than a normal "N=Z" substitution. If you have a word with six N characters in it, the could be encrypted to a different letter each time. Check it out. Given the string "NNNNNN" and using the password "secret", the encrypted string would be 6rp5r7. The two r characters are the same because of the e characters in the password (secret), but the rest are different. But say you are encrypting "|NNNNN". The result would be rrp5r7. So, a r is a pipe (|) character AND an N character! Someone trying to hack it by changing all the r characters to N characters would be WRONG!
And to that the fact you can change the alphabet (leaving out the A character would change a lot!) and that you can loop over the phrase, further encrypting it each time (to decrypt, you would loop the same number of times, further decrypting).