public void RejectSignature() { var toSign = new Dictionary <string, string> { { "a", "xyz" }, { "b", "1234567890" }, { "c", Convert.ToBase64String(Current.Random(16)) }, { "d", "false" } }; var sig = GetSignature("/some/dummy/path", toSign); var fakeAffiliate = new Affiliate { VerificationModulus = "zB3eUr66GkFESizQCnjrm1jCbhHW/vy2UoCHAMIlsOweMOnbU2y8IohlRBEBaS80CqAPlRNfjtRjzdZU3F+J/lUZqipH5sZjXyE6/rPXbvp3tlRSF0pgcQDlFYmAQWKbPKwt2PCg8/Od+wI7cBnHEfveRTjzMzfeFUzoWPiYEo0=" }; var clock = new Stopwatch(); clock.Start(); toSign.Remove("b"); for (int i = 0; i < 100000; i++) { Assert.IsFalse(fakeAffiliate.ConfirmSignature(sig, "/some/dummy/path", toSign), "Affiliate signature check passed and should not have"); } clock.Stop(); Assert.IsTrue(clock.Elapsed < TimeSpan.FromSeconds(120), "100k in 30s [" + clock.Elapsed + "]"); }