Esempio n. 1
0
 public OutputStreamEncryption(Stream outc, byte[] key, int off, int len, int revision)
 {
     this.outc = outc;
     aes       = (revision == AES_128 || revision == AES_256);
     if (aes)
     {
         byte[] iv   = IVGenerator.GetIV();
         byte[] nkey = new byte[len];
         System.Array.Copy(key, off, nkey, 0, len);
         cipher = new AESCipher(true, nkey, iv);
         Write(iv, 0, iv.Length);
     }
     else
     {
         arcfour = new ARCFOUREncryption();
         arcfour.PrepareARCFOURKey(key, off, len);
     }
 }
 /// <summary>Creates a new instance of StandardDecryption</summary>
 public StandardDecryptor(byte[] key, int off, int len)
 {
     arcfour = new ARCFOUREncryption();
     arcfour.PrepareARCFOURKey(key, off, len);
 }