please help me with this
What are the differences between Encrypt+Compress and Compress+Encrypt
When and where do we use them, explain it in a scenario
Thanks & regards Pavan
Attempting to compress encrypted data will generally fail: It's impossible to compress high-entropy (random) data, and encrypted data is typically indistinguishable from random data. (The actual security guarantees may not include indistinguishability from randomness, but often still result in that property being satisfied). So Encrypt then Compress is the ineffective one.
Compress + Encrypt will work and reduce the size of the ciphertext, but ruins security. The compression ratio of the plaintext can leak, which reveals information to the attacker about the content of the plaintext. This is what lead to the CRIME and BREACH attacks on TLS. So Compress then Encrypt is the insecure one. Compress + Encrypt can be secure for storage of data at rest, eg full-disk encryption won't be compromised just because the disk contains compressed data.