public BouncyCastleAes(ITCPClient tcp, byte[] key) { Stream = tcp.GetStream(); EncryptCipher = new BufferedBlockCipher(new CfbBlockCipher(new AesFastEngine(), 8)); EncryptCipher.Init(true, new ParametersWithIV(new KeyParameter(key), key, 0, 16)); DecryptCipher = new BufferedBlockCipher(new CfbBlockCipher(new AesFastEngine(), 8)); DecryptCipher.Init(false, new ParametersWithIV(new KeyParameter(key), key, 0, 16)); }