FileSkink encryption

© Francisco Ruiz, 2016

This page extends the Skink 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.

For details on how the process goes, refer to the Skink cipher page. Essentially, the plaintext data in base64 encoding is fed into a Tabula Recta with mixed alphabets on the sides. The plaintext itself is used as key after a given "seed" value. The inverse process is similar but not identical, so decryption is not the same process as decryption. In this implementation, the user can select two different substitution keys, for a total key space of size (64!)^2, equivalent to 592 bits, plus 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. In this implementation, if nothing is written for key 2 or seed, key 1 is taken for those.

Key 1

Key 2

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:


Key 1 in base64

Key 2 in base64

Seed in base64

Substitution key 1

Substitution key 2


Step 2. Plain file / encrypted file

Now we input the file to be encrypted or decrypted as a link, using the button below. The program will get from the file extension whether it should encrypt or decrypt.

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