Beispiel #1
0
        /// <summary>
        /// Initializes encryption keys based on given <paramref name="password"/>.
        /// </summary>
        /// <param name="password">The password.</param>
        protected void InitializePassword(string password)
        {
            var pkManaged = new PkzipClassicManaged();

            byte[] key = PkzipClassic.GenerateKeys(ZipStrings.ConvertToArray(password));
            cryptoTransform_ = pkManaged.CreateEncryptor(key, null);
        }
Beispiel #2
0
        private void CheckNameConversion(string toCheck)
        {
            byte[] intermediate = ZipStrings.ConvertToArray(toCheck);
            string final        = ZipStrings.ConvertToString(intermediate);

            Assert.AreEqual(toCheck, final, "Expected identical result");
        }