Scrambler ExplainedBack  

The Vigenere algorithm
The scrambling process makes use of a Tableau like this one shown below:

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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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

This example Tableau has 26 rows and 26 columns for each character in the alphabet (capitals only). Notice how every successive row starts with the first character shifted along by one.

The Tableau used in the Scrambler contains more characters than shown in the example to properly cater for mixed-case text and all the printable ASCII symbols such as < and ".

Let's work through the scrambling process now.

In this example we'll use KAREN as a password and we'll scramble the message "MEET ME DOWNSTAIRS"

The password is joined and matched alongside the message like this:

MEET ME DOWNSTAIRS
KARE NK ARENKARENK

Now look up the scrambled characters from the Tableau by taking each paired character (except the spaces which in this example we pass over), the message character will be a row position, the password character a column...

M and K give W
E and A give E

And so on.

Eventually we get the complete scrambled message WEVX ZO DFAACTRMEC

To unscramble, we just reverse the process now pairing the joined password alongside the scrambled message:

KARE NK ARENKARENK
WEVX ZO DFAACTRMEC

Take each paired character, this time the password characters index each row and we look along the row until we find the scrambled character, finally read the original character from the top row at the column position you find the scrambled character in!

K and W give M
A and E give E

When all characters are processed we get the original message!... "MEET ME DOWNSTAIRS"

Scrambler differences:
The Scrambler asks for 2 passwords of at least 3 characters. This is simply to encourage greater variety in the scrambling. The 2 passwords are merely joined together to form a composite of at least 6 characters.

The Scrambler also does extra processing to encode extra characters such as spaces with a standard URL escape sequence (that is a % character followed by 2 hex digits representing the ASCII character code). This is done before scrambling begins and makes the message a little more difficult to decipher.

The scrambled message has the special tags "-START-" and "--END--" wrapped around, this helps in the unscramble process to ensure the message start and end is clearly identified. It would otherwise be too easy for someone to copy in an extra character perhaps and the unscramble process would then fail. These tags are removed before unscrambling begins!

All scrambling and unscrambling is performed in the browser using javascript. None of the original message is stored or transmitted across the Internet.

If you want to read more on cryptography then Bruce Shneier's book below is the reference to get.

The book covers cryptography very thoroughly, you will need a reasonable grasp of mathematics to fully appreciate the contents but it is also filled with interesting and readable sections covering the subject completely.

Applied Cryptography

Bruce Shneier's book
Protocols & Algorithms.