encryption / decryption error checking