SuperFileine encryption

© Francisco Ruiz, 2016

This page extends the Serpentine cipher, by F. Ruiz, so it can be used to encrypt files. The encryption is done using the base64 encoding of the file, which JavaScript handles easily. Essentially, the plaintext data in base64 encoding is fed into a series of five-character "serpentine" operations. In this implementation, the user can write an entirely separate seed of arbitrary length. It also adds two transposition steps under a separate key. The process for decryption is the same as for encryption.


Step 1. Key input and substitution

We begin by taking the user-supplied keys and seed and converting them to base64 through "btoa" operations. Then we make each base64 key this way: take the base64 key and write the different characters in the order they appear in the key, if a character appears again, write instead the first character before it in the base64 alphabet that is still available (wrap around to the end if needed); if after doing this there are base64 characters that did not appear in the key, write them behind in reverse order (this last step is done only for the substitution alphabet, not for transposition). Write a single letter in the key 2 box to turn off transposition. Bear in mind that the keys and seed are case-sensitive.

Key 1 (substitution)

Key 2 (transposition)

If you want to use for the seed phase a key different from key 1, write it in this box, otherwise key 1 will be used also as seed:


Substitution Key in base64

Transposition Key in base64

Seed in base64


Step 2. Plain file / encrypted file

Now we input the file to be encrypted or decrypted as a link, using the button below.

File to be encrypted/decrypted


Step 3. Execution

And now, the all important button, followed by some statistics of the base64 output:


Information about output quality will appear here


Step 4. Encrypted / decrypted file

And here is the file after processing. It can be saved by right-clicking on it (in Chrome, only if below 1.5MB).

Encrypted/decrypted file