Simplified the encryption routines