Authentication & Encryption updates to the learn/app

There is en error in the code (valideCredential crashes when ran non existing user is used) and few password encryption issues.