Esempio n. 1
0
        public void TestTextEncryption2()
        {
            var testEncryptions = EncryptionTest.TestEncryptions();


            foreach (var testEncryption in testEncryptions)
            {
                Console.WriteLine("Using crypto: {0}", testEncryption);
                var str = "long";
                var ms  = new MemoryStream();
                var aw  = new ArchiveWriter(ms);
                aw.Encryption = testEncryption;
                aw.Write(str, 0x1B, 0x73);

                var tmp = ms.ToArray();
                debugArray(tmp);

                tmp = aw.EncodeString(str, out _);
                debugArray(tmp);

                ms.Position = 0;

                var ar = new ArchiveReader(ms);
                ar.SetEncryption(testEncryption);

                Assert.AreEqual(str, ar.ReadString(0x1B, 0x73));
            }
        }