Exemple #1
0
        public void TestBytes()
        {
            var    temp     = Path.GetTempFileName();
            string password = "******";
            var    data     = Enumerable.Range(0, 1024 + 1).Select(val => (byte)val).ToArray();

            AES128File.WriteAllBytes(temp, data, password);

            var readedData = AES128File.ReadAllBytes(temp, password);

            Assert.IsTrue(data.SequenceEqual(readedData));
        }
Exemple #2
0
        public void TestBytes()
        {
            var temp = Path.GetTempFileName();

            byte[] key  = Encoding.UTF8.GetBytes("ABCDEFGHIJKLMNOP");
            var    data = Enumerable.Range(0, 1024 + 1).Select(val => (byte)val).ToArray();

            AES128File.WriteAllBytes(temp, data, key);

            var readedData = AES128File.ReadAllBytes(temp, key);

            Assert.IsTrue(data.SequenceEqual(readedData));
        }