public static void ChangeAccountPassword(RegistratrionFormConstruct registratrionFormConstruct)
        {
            FileInfo      fileInfo      = new FileInfo("F:/SAUGUMO TEST CHAMBER4/PasswordSystemFiles/AccountList.txt.aes");
            AesEcnryption aesEcnryption = new AesEcnryption();

            aesEcnryption.FileDecryption(fileInfo);
            FileInfo info = new FileInfo(fileInfo.FullName.Replace(".aes", ""));
            List <LoginValidationConstructcs> loginValidationConstructcs = new List <LoginValidationConstructcs>();

            //  LoginValidationConstructcs loginValidationConstructcs = new LoginValidationConstructcs();
            foreach (string line in File.ReadAllLines(fileInfo.FullName.Replace(".aes", "")))
            {
                string[] splitString = line.Split(",");
                loginValidationConstructcs.Add(new LoginValidationConstructcs(splitString[0], splitString[1]));
            }
            foreach (LoginValidationConstructcs constructcs in loginValidationConstructcs)
            {
                if (constructcs.username.Equals(registratrionFormConstruct.name, StringComparison.Ordinal))
                {
                    Argon2 argon2 = new Argon2();
                    constructcs.hashValue = argon2.Argon2Impl(registratrionFormConstruct.password);
                }
            }
            File.Create(fileInfo.FullName.Replace(".aes", "")).Dispose();
            List <string> inputList = new List <string>();

            foreach (LoginValidationConstructcs login in loginValidationConstructcs)
            {
                string input = login.username + "," + login.hashValue;
                inputList.Add(input);
            }
            File.AppendAllLines(info.FullName, inputList);
            aesEcnryption.FileEncryption(info);
        }
        public bool LoginDecryptionAndValidation(string username, string password)
        {
            FileInfo      fileInfo      = new FileInfo("F:/SAUGUMO TEST CHAMBER4/PasswordSystemFiles/AccountList.txt.aes");
            AesEcnryption aesEcnryption = new AesEcnryption();

            if (File.Exists("F:/SAUGUMO TEST CHAMBER4/PasswordSystemFiles/AccountList.txt.aes"))
            {
                aesEcnryption.FileDecryption(fileInfo);
                List <LoginValidationConstructcs> validationConstructcs = new List <LoginValidationConstructcs>();
                foreach (string line in File.ReadAllLines(fileInfo.FullName.Replace(".aes", "")))
                {
                    string[] array = line.Split(',');
                    validationConstructcs.Add(new LoginValidationConstructcs(array[0], array[1]));
                }
                foreach (LoginValidationConstructcs loginValidationConstructcs in validationConstructcs)
                {
                    if (loginValidationConstructcs.username.Equals(username))
                    {
                        Argon2 argon2       = new Argon2();
                        string encryptedPSW = aesEcnryption.PasswordEncryption(password);
                        string inputHash    = argon2.Argon2Impl(encryptedPSW);
                        if (inputHash.Equals(loginValidationConstructcs.hashValue, StringComparison.Ordinal))
                        {
                            FileInfo accountList = new FileInfo(fileInfo.FullName.Replace(".aes", ""));
                            aesEcnryption.FileEncryption(accountList);
                            MessageBox.Show("Login Succesfull");
                            return(true);
                        }
                    }
                }
            }

            MessageBox.Show("Wrong password provided");
            FileInfo decryptedFile = new FileInfo(fileInfo.FullName.Replace(".aes", ""));

            aesEcnryption.FileEncryption(decryptedFile);
            return(false);
        }