Encryption & Logout

Changed encryption function. Corrected error with session logout.