Compression and encryption are widely used in network traffic in order to improve efficiency and security of some systems. We propose a scheme to concatenate both functions and run them in a paralle pipelined fashion, demonstrating both a hardware and a software implementation. With minor modifications to the hardware accelerators, latency can be reduced to half. Furthermore, we also propose a seminal and more efficient scheme, where we integrate the technology of encryption into the compression algorithm. Our new integrated optimization scheme reaches an increase of 1.6X by using parallel software scheme However, the security level of our new scheme is not desirable compare with previous ones. Fortunately, we prove that this does not affect the application of our schemes.