public void PasswordEncryptionKey_DataStoreNTHashHistory_W2016_Decrypt() { byte[] binaryPek = "56d98148ec91d111905a00c04fc2d4cfd02cd74ef843d1010000000001000000000000006a35d3fc0e9949135463ab766cac7dbb0c0c0c0c0c0c0c0c0c0c0c0ca93445b678ce5fbe02de23c3c71ff800".HexToBinary(); var pek = new DataStoreSecretDecryptor(binaryPek, PekListVersion.W2016); byte[] blob = "13000000000000009238F8456B0A6113E4175367351C5876F0000000C122DE3142DEA4427488F0F190B88BB36866E41784C95A1DEE8B671680F99AC88A3F0D0AC46BB296DA4DA000624773EF5976793433DD63FDAB2193AC067776AC408C6867E82267935194461BBD7957EACB35D2976465209B62022BCE029BA4C5D036A2B1AA58AC1F2D471A386D4492FC6040741AA137A542219A6F852378D539389D307403B69F97640786B34B8BD5A5246EBA9BA39854B7306B905CE84E9B42C0DDFDE1B74DF32AEDA4FCDE87CD82B3B1EA313E1D2DBD85BF89DB08EAE3641298B40101574E2AA2720E8F7C075EE3C38E20C6387767B9F89585E17379E3FC7F7BBE8D473767EAEAED57C006B477E1D8C9BA06ED2A1A0F10E77C402893B04C0D".HexToBinary(); int rid = 1103; var result = pek.DecryptHashHistory(blob, rid); Assert.AreEqual(15, result.Length); Assert.AreEqual("92937945B518814341DE3F726500D4FF", result[0].ToHex(true)); }
public void PasswordEncryptionKey_DataStoreNTHashHistory_W2k_Decrypt() { byte[] binaryPek = "56d98148ec91d111905a00c04fc2d4cfb0b0f777efcece0100000000010000000000000004b7b3fd6df689af9d6837e840abdc8c".HexToBinary(); var pek = new DataStoreSecretDecryptor(binaryPek, PekListVersion.W2k); byte[] blob = "1100000000000000b9cc6e0358210d60e5f9233a47d4053ccf16b320eec132d7de81b13dace6f4e7".HexToBinary(); int rid = 1375; var result = pek.DecryptHashHistory(blob, rid); Assert.AreEqual(1, result.Length); Assert.AreEqual("92937945B518814341DE3F726500D4FF", result[0].ToHex(true)); }
public void PasswordEncryptionKey_DataStoreNTHashHistory_W2k_Encrypt() { // Prepare the input data byte[] hash1 = "92937945B518814341DE3F726500D4FF".HexToBinary(); byte[] hash2 = "31D6CFE0D16AE931B73C59D7E0C089C0".HexToBinary(); byte[][] hashHistory = new byte[][] { hash1, hash2 }; int rid = 500; byte[] binaryPek = "56d98148ec91d111905a00c04fc2d4cfb0b0f777efcece0100000000010000000000000004b7b3fd6df689af9d6837e840abdc8c".HexToBinary(); var pek = new DataStoreSecretDecryptor(binaryPek, PekListVersion.W2k); // Encrypt and then decrypt the hash history byte[] encryptedHashHistory = pek.EncryptHashHistory(hashHistory, rid); byte[][] decryptedHashHistory = pek.DecryptHashHistory(encryptedHashHistory, rid); // Compare the result with the original data Assert.AreEqual(hashHistory.Length, decryptedHashHistory.Length); for (int i = 0; i < hashHistory.Length; i++) { CollectionAssert.AreEqual(hashHistory[i], decryptedHashHistory[i]); } }
public void PasswordEncryptionKey_DataStoreNTHashHistory_W2016() { byte[] binaryPek = "56d98148ec91d111905a00c04fc2d4cfd02cd74ef843d1010000000001000000000000006a35d3fc0e9949135463ab766cac7dbb0c0c0c0c0c0c0c0c0c0c0c0ca93445b678ce5fbe02de23c3c71ff800".HexToBinary(); var pek = new DataStoreSecretDecryptor(binaryPek, PekListVersion.W2016); byte[] blob = "13000000000000009238F8456B0A6113E4175367351C5876F0000000C122DE3142DEA4427488F0F190B88BB36866E41784C95A1DEE8B671680F99AC88A3F0D0AC46BB296DA4DA000624773EF5976793433DD63FDAB2193AC067776AC408C6867E82267935194461BBD7957EACB35D2976465209B62022BCE029BA4C5D036A2B1AA58AC1F2D471A386D4492FC6040741AA137A542219A6F852378D539389D307403B69F97640786B34B8BD5A5246EBA9BA39854B7306B905CE84E9B42C0DDFDE1B74DF32AEDA4FCDE87CD82B3B1EA313E1D2DBD85BF89DB08EAE3641298B40101574E2AA2720E8F7C075EE3C38E20C6387767B9F89585E17379E3FC7F7BBE8D473767EAEAED57C006B477E1D8C9BA06ED2A1A0F10E77C402893B04C0D".HexToBinary(); int rid = 1103; var result = pek.DecryptHashHistory(blob, rid); Assert.AreEqual(15, result.Length); Assert.AreEqual("92937945B518814341DE3F726500D4FF", result[0].ToHex(true)); }
public void PasswordEncryptionKey_DataStoreNTHashHistory_W2k() { byte[] binaryPek = "56d98148ec91d111905a00c04fc2d4cfb0b0f777efcece0100000000010000000000000004b7b3fd6df689af9d6837e840abdc8c".HexToBinary(); var pek = new DataStoreSecretDecryptor(binaryPek, PekListVersion.W2k); byte[] blob = "1100000000000000b9cc6e0358210d60e5f9233a47d4053ccf16b320eec132d7de81b13dace6f4e7".HexToBinary(); int rid = 1375; var result = pek.DecryptHashHistory(blob, rid); Assert.AreEqual(1, result.Length); Assert.AreEqual("92937945B518814341DE3F726500D4FF", result[0].ToHex(true)); }