public void TestDecimalEncryptionMinPlusTwo() { Decimal initial = FPEWrapper.MinAllowedDecimal + 0.00002M; var encryptedValue = FPEWrapper.EncryptDecimal(key, tweak, initial); var decryptedValue = FPEWrapper.DecryptDecimal(key, tweak, encryptedValue); Assert.AreEqual(initial, decryptedValue); }
public void TestDecimalEncryptionMinusOne() { Decimal initial = -1; var encryptedValue = FPEWrapper.EncryptDecimal(key, tweak, initial); var decryptedValue = FPEWrapper.DecryptDecimal(key, tweak, encryptedValue); Assert.AreEqual(initial, decryptedValue); }
public void TestDecimalEncryptionFiveDecimalPoints() { Decimal initial = 0.00001M; var encryptedValue = FPEWrapper.EncryptDecimal(key, tweak, initial); var decryptedValue = FPEWrapper.DecryptDecimal(key, tweak, encryptedValue); Assert.AreEqual(initial, decryptedValue); }
public void StressTestDecimalEncryption() { Random r = new Random(); int times = 10000; for (int i = 0; i < times; i++) { Decimal plain = r.Next(int.MinValue + 2, int.MaxValue - 2); var enc = FPEWrapper.EncryptDecimal(key, tweak, plain); var dec = FPEWrapper.DecryptDecimal(key, tweak, enc); Console.WriteLine($"Src:{enc}, Dest:{dec}"); Assert.AreEqual(plain, dec); } }
public void TestDecimalEncryptionMinPlusOne() { FPEWrapper.EncryptDecimal(key, tweak, FPEWrapper.MinAllowedDecimal + 0.00001M); }
public void TestDecimalEncryptionMin() { FPEWrapper.EncryptDecimal(key, tweak, FPEWrapper.MinAllowedDecimal); }
public void TestDecimalEncryptionMaxMinusOne() { FPEWrapper.EncryptDecimal(key, tweak, FPEWrapper.MaxAllowedDecimal - 0.00001M); }