Exemplo n.º 1
0
        public void DeriveKeySmallSalt()
        {
            const string PASSWORD      = "******";
            const string SALT          = "4407";
            const long   OUTPUT_LENGTH = 32;
            var          hash1         = KeyDerivation.DeriveKey(Utilities.HexToBinary(PASSWORD), Utilities.HexToBinary(SALT));
            var          hash2         = KeyDerivation.DeriveKey(Utilities.HexToBinary(PASSWORD), Utilities.HexToBinary(SALT));

            Assert.AreEqual(OUTPUT_LENGTH, hash1.Length);
            Assert.AreEqual(OUTPUT_LENGTH, hash2.Length);
            CollectionAssert.AreEqual(hash1, hash2);
        }
Exemplo n.º 2
0
        public void DeriveKeyShortPassTest()
        {
            const string PASSWORD      = "******";
            const string SALT          = "44071f6d181561670bda728d43fb79b443bb805afdebaf98622b5165e01b15fb";
            const long   OUTPUT_LENGTH = 32;
            var          hash1         = KeyDerivation.DeriveKey(Utilities.HexToBinary(PASSWORD), Utilities.HexToBinary(SALT));
            var          hash2         = KeyDerivation.DeriveKey(Utilities.HexToBinary(PASSWORD), Utilities.HexToBinary(SALT));

            Assert.AreEqual(OUTPUT_LENGTH, hash1.Length);
            Assert.AreEqual(OUTPUT_LENGTH, hash2.Length);
            CollectionAssert.AreEqual(hash1, hash2);
        }