Example #1
0
 public void AddPassword(UserPassPair userpass)
 {
     _bank.Add(userpass);
 }
Example #2
0
        public bool LoadPasswordsFromBulkList(byte[] list)
        {
            _bank.Clear();

            UserPassPair userpass = new UserPassPair();
            string temp = string.Empty;
            bool confirmed = false;
            bool username = true; //True = Username, False = Password
            foreach (byte b in list)
            {
                if (b == 0)
                {
                    if (confirmed)
                    {
                        if (username)
                        {
                            userpass.Username = temp;
                            temp = "";
                            username = false;
                        }
                        else
                        {
                            userpass.Password = temp;
                            temp = "";
                            _bank.Add(userpass);
                            username = true;
                        }
                    }
                    else
                    {
                        //If decryption confimartion fails, return false
                        if (temp != Properties.Resources.DECRYPTION_CONFIRMED)
                        {
                            return false;
                        }
                        //If decryption confirmation succeeds, continue loading passwords
                        confirmed = true;
                        temp = "";
                    }
                }
                else
                {
                    temp += (char)b;
                }

            }
            return true;
        }