Ejemplo n.º 1
0
 public string AddSalt(string input, string salt, HashingStatus status)
 {
     if (status.CurrentIteration > 1)
     {
         return(input);
     }
     else
     {
         return(input + salt);
     }
 }
Ejemplo n.º 2
0
        public string GeneratePassword(string secret, int iteration)
        {
            string        result = secret;
            HashingStatus status = new HashingStatus();

            status.CurrentIteration = 0;
            for (int i = 0; i < iteration; ++i)
            {
                ++status.CurrentIteration;

                var spEnmt = saltingProviders.GetEnumerator();
                var svEnmt = saltValues.GetEnumerator();

                while (spEnmt.MoveNext() && svEnmt.MoveNext())
                {
                    result = spEnmt.Current.AddSalt(result, svEnmt.Current, status);
                }

                result = hashingProvider.Hash(result);
            }

            return(postProcessor.Process(result));
        }
Ejemplo n.º 3
0
 public string AddSalt(string input, string salt, HashingStatus status)
 {
     return(input + salt);
 }