コード例 #1
0
        //=====================================
        private MemoryStream decrcfile(Uri File)
        {
            byte[]       ba  = ReadByteArrayFromFile(File.ToString());
            byte[]       dec = EncryptorEvent.DecryptEvent(ba, myKey());
            MemoryStream ms  = new MemoryStream(dec);

            return(ms);
        }
コード例 #2
0
        public static void encrfile(Uri file)
        {
            byte[]       ba       = ReadByteArrayFromFile(file.ToString());
            byte[]       enc      = EncryptorEvent.Encrypt(ba, myKey());
            MemoryStream ms       = new MemoryStream(enc);
            string       FileName = file.ToString().Replace(".mp3", ".sec");

            SaveMemoryStream(ms, FileName);

            ms.Flush();
            ms.Close();
            ms.Dispose();
        }