RC4 encryption
Inheritance: IEncryption
Exemplo n.º 1
0
 /// <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));
 }
Exemplo n.º 2
0
 /// <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));
 }