Esempio n. 1
0
        public Dictionary <string, string> CreateAccountPage()
        {
            using (MD5 MD5Hash = MD5.Create())
            {
                GetMd5Hash getMD5 = new GetMd5Hash();
                Console.Clear();

                Dictionary <string, string> accountInfoDict = new Dictionary <string, string>();
                Console.WriteLine("Welcome to the account creation page");
                Console.Write("\nEnter your username: "******"Enter your password: "******"Please confirm your password: "******"Your passwords do not match.");
                    goto passwordSection;
                }

                string passwordHash = getMD5.MakeMd5Hash(MD5Hash, password);

                accountInfoDict[userHash] = passwordHash;

                Console.WriteLine($"Your username: {userName} \nYour password: {password}");
                Console.WriteLine($"Your hashed username: {userHash} \nYour hashed password: {passwordHash}");

                Console.ReadKey();


                return(accountInfoDict);
            }
        }
Esempio n. 2
0
        public void AuthenticatePage(Dictionary <string, string> dictionary)
        {
            Dictionary <string, string> comparableDict = dictionary;
            Dictionary <string, string> authDict       = new Dictionary <string, string>();

            using (MD5 MDHash = MD5.Create())
            {
                GetMd5Hash getMD5 = new GetMd5Hash();
                Console.Clear();

                Console.WriteLine("Authenticate your user and password information");
                Console.WriteLine("You'll be asked to provide your username and password");
                Console.Write("\nUsername: "******"Password: "******"Username and/or password is not correct");
                            Console.ReadKey();
                        }

                        Console.WriteLine("Authenticated");
                        Console.ReadKey();
                    }
                }
            }
        }