Implemented encrypted login process
Needs much more testing and review and cleanup