createDecryptFunctionWithIv