コード例 #1
0
        public static ListConstruct <TestCase> GetTestCases()
        {
            var testedCyphers = new ListConstruct <TestCase>
            {
                { new NullCypher(), "Null Cypher", 0f },
                { new Vigenere(), "Vigenere", null },
                { new StreamCypher(), "Stream Cypher", null },
                { new FibonacciCypher(), "Fibonacci Cypher", null },
                { new FibonacciCypherV2(), "Fibonacci Cypher V2", null },
                { new FibonacciCypherV3(), "Fibonaccy Cypher V3", null },
                { new CaesarCypher(), "Caesar Cypher", null },
                { new RandomBijection(new NullCypher()), "RandomBijectionDecorator(null)", null },
                { new RandomBijection(new CaesarCypher()), "RandomBijectionDecorator(CaesarCypher)", null },
                { new RandomBijection(new Vigenere()), "RandomBijectionDecorator(Vigenere)", null },
                { new RandomBijection(new FibonacciCypherV3()), "RandomBijectionDecorator(FibonacciCypherV3)", null },
                { new RandomBijection(new StreamCypher()), "RandomBijectionDecorator(StreamCypher)", null },
                {
                    new ChainCypher(
                        typeof(FibonacciCypher),
                        typeof(StreamCypher),
                        typeof(FibonacciCypherV3)),
                    "Chain1",
                    null
                },
                { new TranspositionCypher(), "Transposition Cypher", null }
            };

            return(testedCyphers);
        }
コード例 #2
0
ファイル: TestBase.cs プロジェクト: GKBelmonte/Core
        protected List <EncryptTest> GetEncryptions()
        {
            var res = new ListConstruct <EncryptTest>
            {
                { new NullCypher(), "Null Cypher" },

                { new AutokeyCypher(), "AutoKey Cypher", TestType.All },

                { new BifidCypher(), "Bifid Cypher", TestType.Full | TestType.Xor },

                { new CaesarCypher(), "Caesar Cypher" },
                { new Vigenere(), "Vigenere Cypher" },

                { new HillCypher(), "Hill Cypher", TestType.All },

                { new Rot13(), "Rot 13", AlphabeticCypher.GetSimpleAlphabet(true, false, false), ROT13_TEXTS },

                { new ShuffleCypher(), "Shuffle Cypher", TestType.All },
                { new StreamCypher(), "Stream Cypher" },

                { new SaltedCypher(new StreamCypher()), "Salted Cypher", TestType.All },

                { new TranspositionCypher(), "Transposition Cypher", TestType.All },
                { new ColumnarTranspositionCypher(), "Columnar Transposition Cypher", TestType.All },

                { new FibonacciCypher(), "Fibonacci Cypher" },
                { new FibonacciCypherV2(), "Fibonacci Cypher V2" },
                { new FibonacciCypherV3(), "Fibonacci Cypher V3" },

                { new RandomBijection(new NullCypher()), "RBIJ on Null", TestType.NotXor },
                { new RandomBijection(new Vigenere()), "RBIJ on Vigenere", TestType.NotXor },
                { new RandomBijection(new FibonacciCypher()), "RBIJ on Fibonacci", TestType.NotXor },
                { new RandomBijection(new FibonacciCypherV3()), "RBIJ on FibonaccyV3", TestType.NotXor },
                { new RandomBijection(new StreamCypher()), "RBIJ on Stream", TestType.NotXor },
                {
                    new ChainCypher(
                        typeof(FibonacciCypher),
                        typeof(StreamCypher),
                        typeof(FibonacciCypherV3)),
                    "Chain1",
                    TestType.Full
                },
            };

            return(res);
        }