예제 #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));
 }