static IVGenerator() { rc4 = new ARCFOUREncryption(); byte[] longBytes = new byte[8]; long val = DateTime.Now.Ticks; for (int i = 0; i != 8; i++) { longBytes[i] = (byte)val; val = (long)((ulong)val >> 8); } rc4.PrepareARCFOURKey(longBytes); }
/** Creates a new instance of StandardDecryption */ public StandardDecryption(byte[] key, int off, int len, int revision) { aes = revision == AES_128; if (aes) { this.key = new byte[len]; System.Array.Copy(key, off, this.key, 0, len); } else { arcfour = new ARCFOUREncryption(); arcfour.PrepareARCFOURKey(key, off, len); } }