What is cryptography?
Cryptography is the science of securing information by transforming it so only authorized parties can read it. It is the foundation of modern IT security — HTTPS, VPNs, password storage, digital signatures, and certificates all rely on cryptographic techniques. Mastering cryptography basics is essential for the Security+ exam, where it is one of the highest-weighted domains.

Why cryptography matters in IT security

Every time you log into a website, send an email, or connect to a VPN, cryptography is working in the background to protect your data. Without it, anyone on the network could read your passwords, intercept your messages, or tamper with files in transit.

Cryptography provides three core security properties that you will see repeatedly on the Security+ exam:

The three goals of cryptography
Confidentiality  → Only the intended recipient can read the data (encryption)
Integrity        → Data has not been altered in transit (hashing)
Authentication  → The sender is who they claim to be (digital signatures)

The two types of encryption

All encryption algorithms fall into one of two categories. Knowing the difference — and when each is used — is the most important cryptography concept on the Security+ exam.

Symmetric Encryption
One shared key
Same key encrypts and decrypts
Fast — ideal for large data sets
Key must be shared securely in advance
Key distribution is the main weakness
Examples: AES, DES, 3DES, RC4
Asymmetric Encryption
Public + private key pair
Public key encrypts; private key decrypts
Slower — used for key exchange and signatures
Public key can be shared openly
Solves the key distribution problem
Examples: RSA, ECC, Diffie-Hellman
Exam tip

Speed question: "Which type of encryption is faster?" — Always symmetric.

Key exchange question: "Which solves the key distribution problem?" — Always asymmetric.

Real-world systems use both together: asymmetric encryption to securely exchange a symmetric key, then symmetric encryption for the actual data. This is exactly how TLS/HTTPS works.

Common encryption algorithms

AlgorithmTypeKey SizeWhat to know for the exam
AESSymmetric128, 192, 256-bitCurrent gold standard for symmetric encryption. AES-256 is used in government and enterprise.
DESSymmetric56-bitOutdated and broken — 56-bit key is too short. Replaced by 3DES, then AES.
3DESSymmetric112 or 168-bitApplies DES three times. Deprecated — slower than AES and considered weak.
RSAAsymmetric2048-bit minimumMost common asymmetric algorithm. Used in TLS certificates and digital signatures.
ECCAsymmetric256-bit typicalSame security as RSA with much smaller key sizes. Preferred for mobile and IoT.
Diffie-HellmanAsymmetricVariesUsed for key exchange only — not encryption. Allows two parties to establish a shared secret over an unsecured channel.

Hashing — integrity, not encryption

Hashing is often confused with encryption but they are fundamentally different. Encryption is reversible — you can decrypt ciphertext back to plaintext with the right key. Hashing is a one-way function — it produces a fixed-length output called a digest, and you cannot reverse it to get the original input.

How hashing works
Input (any size)  →  Hash function  →  Fixed-length digest

"password123"     →  SHA-256  →  ef92b778...  (64 hex characters)
"password124"     →  SHA-256  →  9f7b3c2a...  (completely different)

Even a 1-character change produces a completely different hash (avalanche effect)

Hashing is used to verify integrity — that data has not been changed. Common uses include verifying file downloads, storing passwords securely, and detecting tampering.

Hash AlgorithmOutput SizeStatus
MD5128-bit (32 hex)Broken — collision vulnerabilities. Do not use for security purposes.
SHA-1160-bit (40 hex)Deprecated — collision attacks demonstrated. Being phased out.
SHA-256256-bit (64 hex)Current standard. Part of SHA-2 family. Widely used in TLS and certificates.
SHA-3VariableNewer standard with different internal design. Not yet as widely deployed.
bcrypt60 charactersDesigned specifically for password hashing. Slow by design to resist brute force.

Public and private keys — how the key pair works

Asymmetric encryption uses a mathematically linked key pair. What one key encrypts, only the other can decrypt. Understanding which key does what is a frequent exam question.

Public vs private key — rules
Encrypting data to send someone:
  Encrypt with their PUBLIC key  →  only their private key can decrypt

Creating a digital signature:
  Sign with your PRIVATE key  →  anyone with your public key can verify

Public key:  share freely — it is meant to be public
Private key: never share — keep it secret at all times
Exam tip — key pair rules

Encrypting to someone: use their public key. Only their private key can decrypt it.

Digital signature: sign with your private key. Anyone with your public key can verify the signature.

These rules are tested constantly on Security+. Memorize them.

Salting — protecting hashed passwords

When passwords are stored, they should never be stored in plaintext — they are hashed first. But identical passwords produce identical hashes, which makes them vulnerable to rainbow table attacks (pre-computed lists of hash values).

A salt is a random value added to the password before hashing. This ensures that even two users with the same password end up with completely different stored hashes, defeating rainbow table attacks.

Salting in practice
Without salt:
"password123"  →  SHA-256  →  ef92b778...  (same for every user)

With salt:
"password123" + "xK9p2m"  →  SHA-256  →  a3f9c12e...
"password123" + "q7rT4n"  →  SHA-256  →  7b2d8f1c...  (different every time)

Exam scenarios

💬 "Which encryption type is faster for encrypting large amounts of data?" → Symmetric
💬 "A user needs to send an encrypted message to a colleague. Which key should they use to encrypt it?" → The recipient's public key
💬 "Which hashing algorithm is considered broken due to collision vulnerabilities?" → MD5
💬 "What is added to a password before hashing to prevent rainbow table attacks?" → A salt
💬 "Which algorithm provides asymmetric encryption with smaller key sizes than RSA?" → ECC
💬 "A company wants to verify a downloaded file has not been tampered with. Which technique should they use?" → Hashing — compare the file hash to the published hash
💬 "Which protocol allows two parties to securely establish a shared secret over an unsecured network?" → Diffie-Hellman
💬 "Which is a one-way function — encryption or hashing?" → Hashing

Studying for Security+?

See the best study guides, practice exams, and free resources for SY0-701.

See Security+ Resources →

Related Articles