Encrypt and Decrypt now work.
Updated some bits of code that could be re-written