private static void AssertWikipediaVector(string key, string plainText, params byte[] expected) { byte[] keyBytes = Encoding.ASCII.GetBytes(key); byte[] result = Encoding.ASCII.GetBytes(plainText); var arc4 = new Arc4(keyBytes); var encryptedResult = arc4.Encrypt(result); CollectionAssert.AreEqual(expected, encryptedResult); }
public void Dispose() { if (GetHabbo() != null) { GetHabbo().OnDisconnect(); } MachineId = string.Empty; _disconnected = true; _habbo = null; _connection = null; Rc4Client = null; _packetParser = null; }
public SeedRandom(string seed) { var key = new byte[seed.Length]; var pool = new byte[Width]; MixKey(seed, ref key); var arc4 = new Arc4(key); _prng = new Prng(arc4); MixKey(System.Text.Encoding.Default.GetString(arc4.GetSeed()), ref pool); }
public Prng(Arc4 arc4) { _arc4 = arc4; }