add proper error handling when generating the IV when enciphering