throwing exception if no key is present for encryption/decryption
updated answer for #1