Пример #1
0
        public PasswordEncryptionContext EncryptPassword(string password)
        {
            string salt = GetCurrentSalt();

            var request = new PasswordEncryptionContext(password, salt);

            return(EncryptPassword(request));
        }
Пример #2
0
        private PasswordEncryptionContext EncryptPassword(PasswordEncryptionContext request)
        {
            string val = _encryptor.HashAndShift(
                request.EncryptedPassword,
                request.Salt,
                AppConfig.Current.Encryption.ShiftDirection,
                AppConfig.Current.Encryption.ShiftFactor,
                AppConfig.Current.Encryption.ShiftOffset,
                true
                );

            return(new PasswordEncryptionContext(val, request.Salt));
        }
Пример #3
0
 public bool Verify(PasswordEncryptionContext request, string hash)
 {
     return(EncryptPassword(request).EncryptedPassword.Equals(hash));
 }