Esempio n. 1
0
        public Stream Write(Stream stream, byte[] key)
        {
            var crypto = new FantasyTennisRijndaelEngine();

            crypto.Init(true, new KeyParameter(key));
            stream.Write(new byte[] { 6 });
            return(new CryptoStream(stream, crypto, CryptoStreamMode.Write));
        }
Esempio n. 2
0
        public Stream Read(Stream stream, byte[] key)
        {
            var crypto = new FantasyTennisRijndaelEngine();

            crypto.Init(false, new KeyParameter(key));
            crypto.ControlByte = (byte)stream.ReadByte();
            return(new CryptoStream(stream, crypto, CryptoStreamMode.Read));
        }