コード例 #1
0
            public void SetSecret(SecureString secret, SecureString password)
            {
                passHash = BCrypt.Net.BCrypt.HashPassword(Encrypter.SecureStringToString(password));

                _secret = Encrypter.Encrypt(encryptorParams, password, secret);
            }
コード例 #2
0
        public bool GetUserData(string name, string password, out Tuple <string, string> data)
        {
            User _user = CurrentUsers.Find((x) => x.Name == name);

            if (_user == null)
            {
                data = null;
                return(false);
            }

            try
            {
                data = new Tuple <string, string>(_user.KeyApi, System.Text.Encoding.ASCII.GetString(_user.GetSecret(Encrypter.StringtoSecureString(password))));
            }
            catch
            {
                throw;
            }
            password = string.Empty;
            return(true);
        }