TechKnowSurge
VideoSecurityFree

Compromised Key Attack

A compromised key attack occurs when an adversary obtains a cryptographic key—such as a session key or private key—allowing them to intercept, decrypt, or manipulate secured communications between systems.

Complete this video to capture a CTF flag worth 1 point.

About this video

A compromised key attack is a method by which an adversary gains unauthorized access to encrypted communications without ever needing a username, password, or traditional credential. Instead, the attacker targets the cryptographic keys that underpin secure connections. In a standard HTTPS session, a web server holds a private key that both authenticates the server and participates in establishing a secure channel. The client uses the server's public key—which can be freely shared—as part of that handshake. Because asymmetric encryption is computationally expensive, both sides use the initial key exchange to derive a shared session key, which then handles the bulk of the encrypted data transfer. If an adversary obtains the session key, they can decrypt and read the traffic flowing between both parties, and potentially manipulate that data without detection. Compromising the private key carries even greater consequences. Beyond enabling passive interception, a stolen private key allows an attacker to impersonate the legitimate server entirely, creating fraudulent replicas capable of deceiving users into surrendering sensitive information. In both cases, the integrity and confidentiality of the communication are fully undermined. Protecting these keys through secure storage, strict access controls, and timely rotation is a foundational requirement of any robust cryptographic security posture.

What you'll learn

What's covered

Compromised Key Attack

Key terms

Asymmetric Encryption
An encryption method that uses a public key to encrypt data and a private key to decrypt it.
Public Key
A cryptographic key that can be shared openly and is used to encrypt data or verify digital signatures.
Private Key
A secret cryptographic key used in asymmetric encryption to decrypt data or create digital signatures.
Session Key
A temporary symmetric key generated for a single communication session, used to encrypt the bulk of data exchanged between two parties.
Transport Layer Security
TLS
A cryptographic protocol that provides secure communication over a network, successor to SSL.
Man-in-the-Middle Attack
MitM
An attack where an adversary secretly intercepts and potentially alters communications between two parties.

Topics

Cryptography Compromised Key Attack Session Keys Public Key Infrastructure Https Encryption

Transcript

Sometimes an adversary doesn't need a username and password or any type of credentials to access a system. Sometimes they just need some sort of cryptographic key. This is called a compromised key attack.

The scenario

Let's develop a little scenario here. Let's say we have a machine right here that's connecting to a web server. When it connects, it's going to use HTTPS. HTTPS is a secure protocol, so no one can listen in on that conversation.

As it's communicating back and forth, there are a couple of important keys here. One is that this user machine, that's on the browser browsing to this website, has a public key. It's a public key to this web server right here. The public key is really not all that critical — anybody could have access to this public key.

Then we have the private key. What the private key does is help encrypt this data and keep it secure, as well as authenticate this web server. So it's important to really keep this private key very private. You wouldn't want that to get out and into the wrong hands. We need to make sure it's secure.

The session key

Now, this public and private key is a little bit slow in how it encrypts things and how it communicates. So what they do is use this public and private key to create a session key. This session key is shared amongst both sides, and that's what they do the bulk of the encrypting in. So they'll use this public and private key in order to do the initial communication and keep things secure, and then exchange this session key for the communication after that.

The attack

A compromised key attack is when an adversary gets hold of either the session key, which is the same on each side — so it doesn't matter where it gets that from, but if it has access to the session key, it can see the communication going back and forth, and so it's able to listen in on that and possibly change that information.

The other thing here is we have this private key. If it were to get hold of the private key, it could have similar types of repercussions. Plus, this user could do a lot more, like replicate this web server and be able to trick users into thinking that it's the actual website.

So a compromised key attack is either if the session key or private key, or one of these sensitive keys, gets compromised. Here's that attack card on a compromised key: essentially the adversary has one of the keys necessary to be able to view or change the communication going between two different devices. That key is compromised.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →