Beispiel #1
0
        public static Tuple <string, string> CreateNewUser()
        {
            System.Console.WriteLine("Please enter a username: "******"Please enter a password: ");
            string      newUserPass    = Console.ReadLine();
            PassEncrypt newEncryptPass = new PassEncrypt();                                                                    //Instantiate new hashing object

            Tuple <string, string> newUser = new Tuple <string, string>(newUserName, newEncryptPass.EncryptPass(newUserPass)); //Input username and hashed password into UserList dictionary

            return(newUser);
        }
Beispiel #2
0
        public void AuthUser()
        {
            System.Console.WriteLine("Please enter a username: "******"Please enter a password: "******"Sorry, that username is not in the current list of users.");
            }

            else if (UserDict[userName] == newEncryptPass.EncryptPass(userPass)) //Check hashed password against username
            {
                System.Console.WriteLine("You have successfully authenticated.");
            }

            else
            {
                System.Console.WriteLine("Invalid entry. You are now being returned to the main menu.");
            }
        }