Пример #1
0
 public void EnableEncryption(byte[] pSharedSecretKey)
 {
     mDecryptCipher        = Cipher.AES_128_OFB;
     mDecryptCipherContext = new CipherContext(mDecryptCipher);
     mDecryptKey           = new byte[16];
     mDecryptIV            = new byte[16];
     Buffer.BlockCopy(pSharedSecretKey, 0, mDecryptKey, 0, 16);
     Buffer.BlockCopy(pSharedSecretKey, 16, mDecryptIV, 0, 16);
     mProtocolState = EProtocolState.EncryptedAndCompressed;
     AdvanceDecryptIV();
 }
Пример #2
0
 public void EnableInflater()
 {
     mInflater = new ZOutputStream(mInflaterStream);
     mInflater.FlushMode = zlibConst.Z_SYNC_FLUSH;
     mProtocolState = EProtocolState.Compressed;
 }
Пример #3
0
 public void EnableInflater()
 {
     mInflater           = new ZOutputStream(mInflaterStream);
     mInflater.FlushMode = zlibConst.Z_SYNC_FLUSH;
     mProtocolState      = EProtocolState.Compressed;
 }
Пример #4
0
 public void EnableEncryption(byte[] pSharedSecretKey)
 {
     mDecryptCipher = Cipher.AES_128_OFB;
     mDecryptCipherContext = new CipherContext(mDecryptCipher);
     mDecryptKey = new byte[16];
     mDecryptIV = new byte[16];
     Buffer.BlockCopy(pSharedSecretKey, 0, mDecryptKey, 0, 16);
     Buffer.BlockCopy(pSharedSecretKey, 16, mDecryptIV, 0, 16);
     mProtocolState = EProtocolState.EncryptedAndCompressed;
     AdvanceDecryptIV();
 }