Added encrypt and decrypt methods.