Finish implementation of cipher used to encrypt and decrypt.

An in-depth discussion of some of the details can be found here: https://github.com/padlockr/padlockr/wiki/CryptoFactory-notes