1/105
Looks like no tags are added yet.
Cryptography
Practice and study of writing and solving codes; encryption hides information's true meaning
Encryption
Converts plaintext to ciphertext to protect data at rest, in transit, and in use
Data at rest
Inactive data on storage devices (disks, databases, backups)
Data in transit
Data moving across a network
Data in use
Data currently being processed or changed (in memory/CPU)
Algorithm (cipher)
The math that performs encryption or decryption
Key
The secret value that determines the cipher's output; longer key = stronger security
Key rotation
Changing keys regularly so a leaked or cracked key has limited impact
Confidentiality
Only authorized people can read the data (provided by encryption)
Integrity
Data has not been altered (provided by hashing)
Authentication
Proving who sent the data or who you are talking to (signatures and certificates)
Non-repudiation
Sender cannot deny sending the message (provided by digital signatures; NOT by symmetric encryption)
Symmetric encryption
ONE shared secret key encrypts and decrypts; fast; good for bulk data; weakness is key distribution
Asymmetric encryption
TWO keys (public and private); slower; solves key distribution; also called public key cryptography
Hybrid encryption
Asymmetric encryption securely shares a session key, then symmetric encryption protects the bulk data (how HTTPS works)
Stream cipher
Encrypts bit-by-bit or byte-by-byte with a keystream and XOR; good for real-time audio/video; example: RC4
Block cipher
Encrypts fixed-size blocks (64/128/256 bits) and pads the last block; most symmetric algorithms (AES, DES, 3DES)
DES
Symmetric block cipher; 64-bit block; 64-bit key (56 effective); 16 rounds; obsolete
3DES (Triple DES)
Applies DES three times (encrypt-decrypt-encrypt) with up to three 56-bit keys; ~112-bit effective strength; slower than DES
IDEA
Symmetric block cipher; 64-bit block; 128-bit key; faster and stronger than DES but rarely used
AES
Current US government standard; symmetric block cipher; 128-bit block; 128/192/256-bit keys; replaced DES and 3DES
Blowfish
Symmetric block cipher; variable key 32 to 448 bits; DES replacement that was not widely adopted
Twofish
Symmetric block cipher; 128-bit block; 128/192/256-bit keys; open source; Blowfish successor
RC4
Symmetric STREAM cipher by Ron Rivest; 40 to 2048-bit keys; used in SSL and WEP; now insecure
RC5
Symmetric block cipher by Ron Rivest; key sizes up to 2048 bits
RC6
Symmetric block cipher based on RC5; considered as a DES replacement
Only symmetric stream cipher to know
RC4 (all the other listed symmetric algorithms are block ciphers)
Diffie-Hellman (DH)
Asymmetric algorithm used for key EXCHANGE only; used in IPsec VPNs; vulnerable to man-in-the-middle unless authenticated
RSA
Asymmetric algorithm for key exchange, encryption, AND digital signatures; based on factoring large primes; 1024-4096-bit keys
ECC (Elliptic Curve Cryptography)
Asymmetric; smaller keys for equivalent security; efficient for mobile and low-power devices; variants ECDH, ECDHE, ECDSA
ECDH
Elliptic Curve Diffie-Hellman (key exchange using ECC)
ECDHE
Elliptic Curve Diffie-Hellman Ephemeral (temporary keys per session)
ECDSA
Elliptic Curve Digital Signature Algorithm
DSA
Digital Signature Algorithm; signatures only; uses a 160-bit message digest created per DSS (Digital Signature Standard)
Which key do you use to encrypt for confidentiality?
The RECEIVER'S PUBLIC key
Which key decrypts a message encrypted with your public key?
Your PRIVATE key
Which key creates a digital signature?
The SENDER'S PRIVATE key
Which key verifies a digital signature?
The SENDER'S PUBLIC key
Public/private key rule of thumb
Public key = lock or verify. Private key = unlock or sign.
Digital signature
A hash digest of a message encrypted with the sender's private key; provides integrity, authentication, and non-repudiation
How a digital signature works
1) Sender hashes message 2) Sender encrypts hash with private key 3) Recipient decrypts with sender's public key 4) Recipient compares to own hash of the message
To get confidentiality AND a signature
Sign with sender's private key and also encrypt the message with the receiver's public key
Hashing
One-way function that produces a fixed-length digest (fingerprint); cannot be reversed; verifies integrity
Hash digest
Fixed-length output of a hash function regardless of input size; changes drastically if input changes slightly
MD5
Hash algorithm; 128-bit digest; collisions found; not recommended for security
SHA-1
Hash algorithm; 160-bit digest; less collision-prone than MD5; deprecated
SHA-2
Hash family with 224, 256, 384, and 512-bit digests; current workhorse (SHA-256 common)
SHA-3
Newest SHA family; 224 to 512-bit digests; more secure
RIPEMD
Open-source competitor to SHA; 160-bit most common; also 256 and 320-bit
HMAC
Hash-based Message Authentication Code; hash plus a shared secret key; provides integrity AND authenticity (e.g., HMAC-SHA256)
Hash vs HMAC
Hash proves data did not change; HMAC also proves who made it because it uses a secret key
Pass the hash attack
Attacker authenticates using a stolen password hash instead of the plaintext password; Mimikatz automates it
Pass the hash prevention
Trusted OS, proper domain trusts, patching, multi-factor authentication, least privilege
Birthday attack
Collision attack that finds two different inputs with the same hash; named for the birthday paradox; mitigated by longer hashes (e.g., SHA-256)
Collision attack
Finding two different inputs that produce the same hash output; undermines integrity checks (e.g., MD5)
Key stretching
Makes weak keys/passwords stronger and slows cracking by increasing time per guess; used in WPA, WPA2, and PGP
Salting
Adding random data to a password BEFORE hashing so identical passwords give different hashes; defeats rainbow tables and dictionary attacks
Nonce
Number used once; unique value that prevents replay attacks in authentication
Account lockout (limiting failed logins)
Locks the account after a set number of failed attempts (typically 3) to deter password guessing
Which defense stops rainbow tables?
Salting (and key stretching)
Which defense stops replay attacks?
Nonces
PKI (Public Key Infrastructure)
Entire framework of hardware, software, policies, procedures, and people that manages keys and digital certificates
PKI vs public key cryptography
PKI is the whole system; public key cryptography is just the encrypt/decrypt process that is one part of PKI
HTTPS connection steps
1) Browser gets server's certificate/public key 2) Validates with trusted CA 3) Random session key generated 4) Session key encrypted with server's public key 5) Server decrypts with private key 6) Both use session key for symmetric encryption (e.g., AES)
Digital certificate
Digitally signed electronic document that binds a public key to an identity; uses the X.509 standard
X.509
Standard format for digital certificates in PKI
Certificate Authority (CA)
Trusted third party that issues, signs, validates, and manages digital certificates
Registration Authority (RA)
Collects and verifies identity information and forwards certificate requests to the CA
Certificate Signing Request (CSR)
Encoded block of text with requester info and PUBLIC key sent to the CA; private key stays with the requester
Root of trust
Highest level of trust in certificate validation; top CA that forms the certification path
Certificate Revocation List (CRL)
List of revoked certificates maintained by the CA; checked before trusting a certificate
OCSP
Online Certificate Status Protocol; checks revocation status of a certificate by serial number; faster than CRL
OCSP stapling
Certificate holder gets the OCSP response from the CA and includes it in the TLS handshake; speeds up secure tunnel creation
Public key pinning
Website presents trusted public keys to browsers so fraudulent certificates are detected and rejected
Key escrow
Storage of cryptographic keys with a secure third party so keys can be recovered after loss or for legal investigations
Key recovery agent
Software/role that restores a lost or corrupted key; acts as a backup for CA keys
Wildcard certificate
One certificate covers all subdomains of a domain (*.example.com); cheaper and easier, but one compromise affects every subdomain
SAN certificate
Subject Alternate Name; lists specific additional domains and IPs; used when domains do not share the same root
Self-signed certificate
Signed by the same entity it certifies; provides encryption but no third-party trust; used for testing or closed systems
Third-party certificate
Issued and signed by a trusted CA; trusted by browsers; preferred for public-facing sites
Single-sided certificate authentication
Only the server is validated
Dual-sided certificate authentication
Both client and server validate each other; more secure but needs more processing
Blockchain
Decentralized, immutable shared ledger; each block holds the previous block's hash, a timestamp, and transaction data
Why blockchain is tamper-evident
Each block contains the hash of the previous block, so changing one block breaks the chain
Smart contract
Self-executing contract with code-defined terms that runs automatically when conditions are met
Blockchain use in supply chains
Immutable records of product origin, handling, and distribution give transparency and traceability
TPM (Trusted Platform Module)
Dedicated chip on a device that stores cryptographic keys; used by BitLocker drive encryption
HSM (Hardware Security Module)
Physical tamper-proof device that generates, stores, and manages keys; used for mission-critical needs like banking and CAs
Key Management System (KMS)
Centralized management of the key lifecycle: create, store, distribute, rotate, retire
Secure enclave
Isolated coprocessor inside the main processor that protects sensitive data such as biometrics
TPM vs HSM
TPM is built into a single device; HSM is a separate, more powerful appliance or card for servers and organizations
Obfuscation
Making data harder to understand or find; includes steganography, tokenization, and data masking
Steganography
Hides a message inside another file (image, audio) to hide that the message exists; encryption hides meaning, steganography hides existence
Tokenization
Replaces sensitive data with a meaningless token; original stored securely elsewhere; common in payment systems
Data masking
Hides part of sensitive data (e.g., showing only last 4 card digits); keeps data usable for testing and development
Cryptographic attack
Technique used to exploit weaknesses in cryptographic systems to compromise confidentiality, integrity, or authenticity
Downgrade attack
Forces a system to use weaker or older protocols or ciphers; example: POODLE attack on SSL 3.0
Downgrade attack defense
Phase out support for insecure/old protocols and use version-intolerant checks
POODLE
Downgrade attack that exploits SSL 3.0
Quantum computing threat
Quantum computers using qubits could rapidly factor large numbers and break RSA and ECC