Packets travelling over TCP are not encrypted by default. When we use TLS, the packets travelling on the TCP are encrypted.
However, what prevents this encrypted packet from being captured and replayed by an attacker?
Join Stack Overflow to learn, share knowledge, and build your career.
TLS has been updated with replay protection since TLS 1.3. See page 98 of the RFC.
And you've asked a very common question - unfortunately the main original questions are on other StackExchange sites and SO doesn't let us close questions as duplicates of questions on other sites (grrrrrr).
When we talk about TLS/SSL on TCP connection, actually is that the http packet is encrypted by the cryptographic algorithm dealed by client and server after handshaking, and transferd by TCP. TLS is upper than TCP and serves the application layer. And for prevent being captured and replaced, we cannot avoid the packet to be captured.but due to the packet is encrypt, if we want to "repalce" this we have to decryption, change and encryption. but how can the attaker decrypt the packet without key.