static IvGenerator() { _rc4 = new ArcfourEncryption(); var longBytes = new byte[8]; var val = DateTime.Now.Ticks; for (var i = 0; i != 8; i++) { longBytes[i] = (byte)val; val = (long)((ulong)val >> 8); } _rc4.PrepareArcfourKey(longBytes); }
/// <summary> /// Creates a new instance of StandardDecryption /// </summary> public StandardDecryption(byte[] key, int off, int len, int revision) { _aes = revision == Aes128; if (_aes) { _key = new byte[len]; Array.Copy(key, off, _key, 0, len); } else { Arcfour = new ArcfourEncryption(); Arcfour.PrepareArcfourKey(key, off, len); } }