Beispiel #1
0
        public static string Decrypt(IPasswordProvider psw, string path)
        {
            var data = VocabularyProviderFactory.CreateProvider(psw.RawPassword);

            using (var reader = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                return(Decrypt(data, reader));
            }
        }
Beispiel #2
0
        public static void Encrypt(IPasswordProvider psw, string what, string where)
        {
            var data = VocabularyProviderFactory.CreateProvider(psw.RawPassword);

            using (var writer = new FileStream(where, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None))
            {
                Encrypt(data, what, writer);
            }
        }