DKIM (DomainKeys Identified Mail) Cryptographic Signing
You'll learn how DKIM uses public-key cryptography to prove an email actually came from the claimed domain.
What Is DKIM?
DKIM is an email authentication method that allows the sending domain to "sign" outgoing messages with a digital signature. This signature proves the email genuinely originated from that domain and hasn't been tampered with in transit. Think of it like a wax seal on a historical letter—breaking the seal reveals tampering.
How DKIM Works
When your mail server sends an email, it creates a cryptographic hash of specific email headers and the message body. This hash is then encrypted using a private key that only the sending domain controls. The encrypted hash becomes the DKIM signature, added to the email's headers as DKIM-Signature:.
The receiving mail server retrieves the sender's public key from a DNS TXT record (published at selector._domainkey.example.com). It uses this public key to decrypt the signature and verify it matches a fresh hash of the received email. If they match, the email is authentic and unmodified.
Why It Matters for Security
DKIM directly combats email spoofing—a core social engineering attack vector you've studied. While SPF verifies the sending server's IP address, DKIM verifies the message content itself. An attacker can't forge a valid DKIM signature without access to your private key.
When combined with SPF and DMARC policies, DKIM forms a robust defense against phishing, BEC attacks, and domain impersonation—all techniques attackers use to manipulate targets through pretexting and authority impersonation.
The Cryptographic Foundation
DKIM relies on asymmetric cryptography: the private key signs (encrypts the hash), the public key verifies (decrypts and compares). This ensures only the legitimate domain owner can create valid signatures, while anyone can verify them.
Key Takeaway: DKIM uses public-key cryptography to create unforgeable email signatures, proving both sender authenticity and message integrity—critical defenses against social engineering attacks via email spoofing.