some fixes to the encryption methods