Ejemplo n.º 1
0
        /// <summary>
        /// Test the VolumeCipher class implementation
        /// </summary>
        public static void VolumeCipherTest(string InputDirectory)
        {
            string[] paths = DirectoryTools.GetFiles(InputDirectory);

            // key will be written to this stream
            MemoryStream keyStream = new MemoryStream();

            // encrypt the files in the directory
            using (VolumeCipher vc = new VolumeCipher())
            {
                keyStream = vc.CreateKey(CipherDescription.AES256CTR, paths.Length);
                vc.Initialize(keyStream);
                vc.Encrypt(paths);
            }

            // decrypt the files
            using (VolumeCipher vc = new VolumeCipher())
            {
                vc.Initialize(keyStream);
                vc.Decrypt(paths);
            }

            // manual inspection of files..
        }