Exemplo n.º 1
0
 public void GenerateSaltStringTest()
 {
     HashAlgorithm HashAlgorithm = null; // TODO: Initialize to an appropriate value
     int theSaltLength = 0; // TODO: Initialize to an appropriate value
     Hash target = new Hash(HashAlgorithm, theSaltLength); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     actual = target.GenerateSaltString();
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 2
0
 public void VerifyHashTest()
 {
     HashAlgorithm HashAlgorithm = null; // TODO: Initialize to an appropriate value
     int theSaltLength = 0; // TODO: Initialize to an appropriate value
     Hash target = new Hash(HashAlgorithm, theSaltLength); // TODO: Initialize to an appropriate value
     byte[] Data = null; // TODO: Initialize to an appropriate value
     byte[] Hash = null; // TODO: Initialize to an appropriate value
     byte[] Salt = null; // TODO: Initialize to an appropriate value
     bool expected = false; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.VerifyHash(Data, Hash, Salt);
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
Exemplo n.º 3
0
 public void HashConstructorTest()
 {
     HashAlgorithm HashAlgorithm = null; // TODO: Initialize to an appropriate value
     int theSaltLength = 0; // TODO: Initialize to an appropriate value
     Hash target = new Hash(HashAlgorithm, theSaltLength);
     Assert.Inconclusive("TODO: Implement code to verify target");
 }
Exemplo n.º 4
0
 public void GetHashAndSaltTest()
 {
     HashAlgorithm HashAlgorithm = null; // TODO: Initialize to an appropriate value
     int theSaltLength = 0; // TODO: Initialize to an appropriate value
     Hash target = new Hash(HashAlgorithm, theSaltLength); // TODO: Initialize to an appropriate value
     byte[] Data = null; // TODO: Initialize to an appropriate value
     byte[] Hash = null; // TODO: Initialize to an appropriate value
     byte[] HashExpected = null; // TODO: Initialize to an appropriate value
     byte[] Salt = null; // TODO: Initialize to an appropriate value
     byte[] SaltExpected = null; // TODO: Initialize to an appropriate value
     target.GetHashAndSalt(Data, out Hash, out Salt);
     Assert.AreEqual(HashExpected, Hash);
     Assert.AreEqual(SaltExpected, Salt);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Exemplo n.º 5
0
 public void GetHashAndSaltStringTest()
 {
     HashAlgorithm HashAlgorithm = null; // TODO: Initialize to an appropriate value
     int theSaltLength = 0; // TODO: Initialize to an appropriate value
     Hash target = new Hash(HashAlgorithm, theSaltLength); // TODO: Initialize to an appropriate value
     string clearPassword = string.Empty; // TODO: Initialize to an appropriate value
     string Hash = string.Empty; // TODO: Initialize to an appropriate value
     string HashExpected = string.Empty; // TODO: Initialize to an appropriate value
     string Salt = string.Empty; // TODO: Initialize to an appropriate value
     string SaltExpected = string.Empty; // TODO: Initialize to an appropriate value
     target.GetHashAndSaltString(clearPassword, out Hash, out Salt);
     Assert.AreEqual(HashExpected, Hash);
     Assert.AreEqual(SaltExpected, Salt);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Exemplo n.º 6
0
 public static string ToHash(string plainText, string salt=null, int saltLength=8, HashAlgorithm algorithm = null)
 {
     Hash hash = new Hash(algorithm, saltLength);
     return hash.GetHashString(plainText, salt);
 }