コード例 #1
0
        static void Main(string[] args)
        {
            var scrambler = new Scrambler("DESENVOLVIMENTO!").WithKey("ABCDEFGHIJKLMNOP", 4);

            scrambler.Encrypt();
            Console.ReadLine();
        }
コード例 #2
0
        public void CryptEncryptScrambler()
        {
            const int scramblerValue = 321;
            const int startedKey = 1232423;
            var scrambler = new Scrambler(scramblerValue, startedKey);
            var deScrambler = new Scrambler(scramblerValue, startedKey);

            const byte data = 123;
            var cryptedData = scrambler.Encrypt(data);
            Assert.AreNotEqual(data, cryptedData);

            var deCryptedData = deScrambler.Encrypt(cryptedData);
            Assert.AreEqual(data, deCryptedData);
        }
コード例 #3
0
        public void CryptEncryptScrambler()
        {
            const int scramblerValue = 321;
            const int startedKey     = 1232423;
            var       scrambler      = new Scrambler(scramblerValue, startedKey);
            var       deScrambler    = new Scrambler(scramblerValue, startedKey);

            const byte data        = 123;
            var        cryptedData = scrambler.Encrypt(data);

            Assert.AreNotEqual(data, cryptedData);

            var deCryptedData = deScrambler.Encrypt(cryptedData);

            Assert.AreEqual(data, deCryptedData);
        }