示例#1
0
        public static void TestTwo()
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();

            var encryptedString = DesEncryptor.Encrypt("password", "012345678901234567890123");
            var plainString     = DesEncryptor.Decrypt(encryptedString, "012345678901234567890123");

            stopwatch.Stop();
            var elapsed = stopwatch.ElapsedMilliseconds;

            Console.WriteLine($"took: {elapsed}ms resultEncrypted: {encryptedString} resultDecrypted: {plainString}");
        }
示例#2
0
        public static void TestFour()
        {
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            for (var i = 0; i < 100; i++)
            {
                var encryptedString = DesEncryptor.Encrypt("password", "012345678901234567890123");
                var plainString     = DesEncryptor.Decrypt(encryptedString, "012345678901234567890123");
            }
            stopwatch.Stop();

            var elapsed = stopwatch.ElapsedMilliseconds;

            Console.WriteLine($"took: {elapsed}ms");
        }