Fileine 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. The process for decryption is the same as for encryption. In this implementation, the user can an entirely separate seed of arbitrary length.

 

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

Key

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

Seed

Key in base64

Seed in base64

Substitution key

 

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