/// <summary> /// Instantiate the cryptors with the keys: Hash(encryptionSalt, S, SKEY) for the encryptor and /// Hash(encryptionSalt, S, SKEY) for the decryptor. /// (encryptionSalt should be "keyA" if you're A, "keyB" if you're B, and reverse for decryptionSalt) /// </summary> /// <param name="encryptionSalt">The salt to calculate the encryption key with</param> /// <param name="decryptionSalt">The salt to calculate the decryption key with</param> protected void CreateCryptors(string encryptionSalt, string decryptionSalt) { encryptor = new RC4(Hash(Encoding.ASCII.GetBytes(encryptionSalt), S, SKEY.Hash)); decryptor = new RC4(Hash(Encoding.ASCII.GetBytes(decryptionSalt), S, SKEY.Hash)); }
/// <summary> /// Instantiate the cryptors with the keys: Hash(encryptionSalt, S, SKEY) for the encryptor and /// Hash(encryptionSalt, S, SKEY) for the decryptor. /// (encryptionSalt should be "keyA" if you're A, "keyB" if you're B, and reverse for decryptionSalt) /// </summary> /// <param name="encryptionSalt">The salt to calculate the encryption key with</param> /// <param name="decryptionSalt">The salt to calculate the decryption key with</param> protected void CreateCryptors(byte[] encryptionSalt, byte[] decryptionSalt) { encryptor = new RC4(Hash(encryptionSalt, S, SKEY.Hash)); decryptor = new RC4(Hash(decryptionSalt, S, SKEY.Hash)); }
/// <summary> /// Instantiate the cryptors with the keys: Hash(encryptionSalt, S, SKEY) for the encryptor and /// Hash(encryptionSalt, S, SKEY) for the decryptor. /// (encryptionSalt should be "keyA" if you're A, "keyB" if you're B, and reverse for decryptionSalt) /// </summary> /// <param name="encryptionSalt">The salt to calculate the encryption key with</param> /// <param name="decryptionSalt">The salt to calculate the decryption key with</param> protected void CreateCryptors(string encryptionSalt, string decryptionSalt) { encryptor = new RC4(Hash(Encoding.UTF8.GetBytes(encryptionSalt), S, SKEY.Hash)); decryptor = new RC4(Hash(Encoding.UTF8.GetBytes(decryptionSalt), S, SKEY.Hash)); }