public void StringCrypt_Basic_RFC2898() { string input = "test 123 %$#"; byte[] output = StringCrypt.EncryptRfc2898(input); string outputFinal = StringCrypt.DecryptRfc2898(output); Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt."); }
public void StringCrypt_Specific_RFC2898_Salt() { string input = "foobar and some special characters $%^&*()"; RFC2898CryptInfo cryptInfo = new RFC2898CryptInfo(); cryptInfo.salt = "RandomSalt12634asdf"; byte[] output = StringCrypt.EncryptRfc2898(input, cryptInfo); string outputFinal = StringCrypt.DecryptRfc2898(output, cryptInfo); Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt."); }
public void StringCrypt_Specific_RFC2898_Password() { string input = "foobar and some special characters $%^&*()"; RFC2898CryptInfo cryptInfo = new RFC2898CryptInfo(); cryptInfo.password = "******"; byte[] output = StringCrypt.EncryptRfc2898(input, cryptInfo); string outputFinal = StringCrypt.DecryptRfc2898(output, cryptInfo); Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt."); }
public void StringCrypt_Specific_RFC2898_VIKey() { string input = "foobar and some special characters $%^&*()"; RFC2898CryptInfo cryptInfo = new RFC2898CryptInfo(); cryptInfo.VIKey = "abc12366FFTYYU^d"; byte[] output = StringCrypt.EncryptRfc2898(input, cryptInfo); string outputFinal = StringCrypt.DecryptRfc2898(output, cryptInfo); Assert.AreEqual(input, outputFinal, "String output should be as exected after decrypt."); }
public void StringCrypt_Specific_RFC2898_WrongVIKey() { string input = "foobar and some special characters $%^&*()"; RFC2898CryptInfo cryptInfo1 = new RFC2898CryptInfo(); cryptInfo1.VIKey = "983GET$%I8876824"; RFC2898CryptInfo cryptInfo2 = new RFC2898CryptInfo(); cryptInfo2.VIKey = "Sdfert@$#G53df$#"; byte[] output = StringCrypt.EncryptRfc2898(input, cryptInfo1); string outputFinal = StringCrypt.DecryptRfc2898(output, cryptInfo2); Assert.AreNotEqual(input, outputFinal, "String output should not be decryptable."); }
public void StringCrypt_Specific_RFC2898_WrongSalt() { string input = "foobar and some special characters $%^&*()"; RFC2898CryptInfo cryptInfo1 = new RFC2898CryptInfo(); cryptInfo1.salt = "salt1ABCD"; RFC2898CryptInfo cryptInfo2 = new RFC2898CryptInfo(); cryptInfo2.salt = "salt2ABCD"; byte[] output = StringCrypt.EncryptRfc2898(input, cryptInfo1); string outputFinal = StringCrypt.DecryptRfc2898(output, cryptInfo2); Assert.AreNotEqual(input, outputFinal, "String output should not be decryptable."); }
public void StringCrypt_Specific_RFC2898_WrongPassword() { string input = "foobar and some special characters $%^&*()"; RFC2898CryptInfo cryptInfo1 = new RFC2898CryptInfo(); cryptInfo1.password = "******"; RFC2898CryptInfo cryptInfo2 = new RFC2898CryptInfo(); cryptInfo2.password = "******"; byte[] output = StringCrypt.EncryptRfc2898(input, cryptInfo1); string outputFinal = StringCrypt.DecryptRfc2898(output, cryptInfo2); Assert.AreNotEqual(input, outputFinal, "String output should not be decryptable."); }