Updated to encrypt/decrypt keys to and from the database