Network security

Cryptography Explained: Types, Algorithms and How It Protects You

Cryptography is the mathematics that keeps your messages, passwords, and payments private. Here is how encryption, hashing, and digital signatures fit together.

Cysoro Security TeamPublished · 8 min read
AES-256SHA-256 · RSA · ECC 0101 11001010 01111101 0010 NETWORK SECURITY Crypto-graphy The math that keeps secrets secret.
Quick answer

Cryptography is the science of securing information with mathematics so only authorized parties can read or use it. It covers encryption, which scrambles data reversibly, hashing, which creates a one-way fingerprint, and digital signatures, which prove who sent a message and that it was not changed.

Key takeaways

  • Cryptography protects confidentiality with encryption, integrity with hashing, and authenticity with digital signatures.
  • Real systems combine asymmetric cryptography for key exchange with fast symmetric encryption for bulk data.
  • Never invent your own cryptography: use vetted standards such as AES, SHA-256, and TLS 1.3.

Every time you log in, send a message, or pay online, cryptography is working in the background. It is the reason a stranger on the same Wi-Fi network cannot read your banking session, and the reason your phone can prove a software update really came from the vendor.

What is cryptography?

Cryptography is the science of securing information with mathematics so that only authorized parties can read or use it. It transforms readable data into an unreadable form, and provides ways to check that data has not been changed and to prove who created it.

NIST describes cryptography as the discipline that embodies the principles, means, and methods for transforming data to hide its meaning, prevent unauthorized use, or prevent undetected modification. That definition covers three jobs: keeping secrets, detecting tampering, and proving identity.

You do not need advanced mathematics to use it well. The practical rule is simple: use vetted, standard algorithms and libraries, and never invent your own. The mathematics is public and studied by experts; the security rests on the key, not on keeping the method secret.

What is cryptography in cyber security?

In cyber security, cryptography is the technical foundation for confidentiality, integrity, and authentication. It protects data in transit on networks, data at rest on disks, and the identities of the people and services communicating.

It shows up everywhere: TLS encrypts web traffic, VPNs encrypt network traffic, messaging apps encrypt chats end to end, password managers encrypt vaults, and code signing proves software updates are genuine. Without it, passwords, payment details, and private messages would travel in plain text.

Cryptography alone does not make a system secure. Keys must be generated, stored, rotated, and revoked correctly, software must be updated, and people must still avoid phishing. A strong cipher with a leaked key protects nothing, which is why key management matters as much as the algorithm.

How does cryptography work?

Cryptography works by combining a public algorithm with a secret key. The algorithm is the recipe; the key is the secret ingredient. The same algorithm with a different key produces a completely different result.

To encrypt, you feed plaintext and a key into the algorithm and get ciphertext. To decrypt, you feed the ciphertext and the right key back in and recover the plaintext. Anyone without the key sees only scrambled data, even if they know exactly which algorithm was used.

This is why open, standard algorithms are safer than secret ones. AES, for example, has been studied by thousands of experts since NIST standardized it in FIPS 197. A home-grown cipher, by contrast, usually fails the first time a skilled attacker looks at it.

Encryption in one picturePlaintextHello, worldreadable data+ Secret keythe only secretpart of the systemCiphertext9f2c a71e 04bdscrambled dataDecryption reverses the process with the same key (symmetric)or the matching private key (asymmetric).The algorithm is public. The key is secret. Lose the key, lose the data.
Plaintext plus a key becomes ciphertext; decryption reverses it. Illustration by Cysoro.

What are the main types of cryptography?

The three main types are symmetric cryptography, asymmetric cryptography, and hash functions. Most real systems use all three together, each doing the job it does best.

TypeKeysMain jobCommon algorithms
SymmetricOne shared secret keyFast bulk encryptionAES, ChaCha20
AsymmetricPublic key plus private keyKey exchange, signaturesRSA, ECC, ML-KEM, ML-DSA
Hash functionsNo key (usually)One-way fingerprintsSHA-256, SHA-3
Digital signaturesPrivate key signs, public key verifiesAuthenticity, non-repudiationRSA, ECDSA, Ed25519, ML-DSA

Symmetric encryption is fast and ideal for large amounts of data. Asymmetric encryption is slower but solves the key-sharing problem. Hashing is not encryption at all: it is a one-way fingerprint used to check integrity.

What is symmetric cryptography?

Symmetric cryptography uses the same secret key to encrypt and decrypt. Both sides must hold the key, and anyone who learns the key can read the data, so sharing the key safely is the hard part.

The standard is AES, specified in NIST FIPS 197. AES-128 and AES-256 are both widely used; AES-256 uses a longer key and is the conservative choice for data that must stay secret for a long time. ChaCha20 is another modern symmetric cipher, often used in TLS on mobile devices.

Symmetric ciphers come in two forms: block ciphers such as AES, which encrypt fixed-size blocks, and stream ciphers such as ChaCha20, which encrypt data bit by bit. In practice, they are used with a mode of operation and an authentication tag, so tampering is detected as well as hidden.

What is asymmetric cryptography?

Asymmetric cryptography uses a key pair: a public key anyone can know, and a private key only the owner holds. Data encrypted with the public key can only be decrypted with the private key, and a signature made with the private key can be verified with the public key.

RSA and elliptic curve cryptography (ECC) are the classic examples. ECC reaches the same security strength as RSA with much shorter keys, which is why it is common on phones and in TLS certificates. The trade-off is speed: NIST notes that symmetric algorithms are generally significantly faster than asymmetric ones.

Asymmetric cryptography has two main uses: establishing shared keying material, and creating and verifying digital signatures. It is not normally used to encrypt large files directly, because it is too slow for that job.

What is hashing, and how is it different from encryption?

Hashing takes any input and produces a fixed-length fingerprint called a hash or digest. It is one-way: you cannot reverse a hash to recover the original data, and even a tiny change to the input produces a completely different hash.

Encryption protects confidentiality and is reversible with the right key. Hashing protects integrity: if a downloaded file's SHA-256 hash matches the vendor's published hash, the file was not changed in transit. NIST warns that a plain hash alone gives no assurance against an attacker who can replace both the data and the hash.

Passwords should be stored as hashes, not encrypted, so that even a database breach does not reveal them directly. Proper password storage adds a unique salt per password and uses a slow, purpose-built function such as Argon2 or bcrypt, so guessing is expensive. You can see a hash in action with our free hash generator.

What are digital signatures and PKI?

A digital signature combines hashing and asymmetric cryptography to prove who created a message and that it was not changed. The signer hashes the message and encrypts the hash with their private key; anyone can verify it with the public key.

Public key infrastructure (PKI) solves the next problem: how do you know a public key really belongs to the person or website it claims to belong to? A certificate authority (CA) issues a certificate binding a public key to a name, after checking the applicant's identity.

That is how HTTPS works. When you visit a site, your browser checks its certificate, verifies the CA's signature, and only then trusts the public key it contains. Our SSL checker shows the certificate chain for any public site, so you can see this in action.

How do symmetric and asymmetric cryptography work together in TLS?

TLS uses a hybrid approach: asymmetric cryptography authenticates the server and agrees on a shared secret, then fast symmetric encryption protects the bulk of the data. This is the pattern NIST describes for most real systems.

In TLS 1.3, defined in RFC 8446, the handshake authenticates the communicating parties, negotiates the cryptographic settings, and establishes shared keying material. The browser and server then switch to a symmetric cipher such as AES-GCM or ChaCha20-Poly1305 for the rest of the session.

TLS 1.3 also removed older, weaker options, including static RSA key transport, so key exchange is now based on Diffie-Hellman methods. The result is forward secrecy: even if a server's long-term key is stolen later, past sessions cannot be decrypted from recorded traffic.

Where is cryptography used every day?

Cryptography is used in web browsing, messaging, banking, software updates, and device unlocking. Most of it is invisible, which is the point: good cryptography works without asking you to understand it.

  • Web browsing: HTTPS (TLS) encrypts traffic between your browser and the site.
  • Messaging: apps such as Signal and WhatsApp use end-to-end encryption, so only sender and receiver can read messages.
  • Banking and payments: card chips, mobile wallets, and online payments use encryption and signatures to protect transactions.
  • Passwords: password managers encrypt your vault, and services store password hashes rather than plain-text passwords.
  • Software updates: code signing proves an update came from the vendor and was not tampered with.
  • Devices: full-disk encryption protects data on a lost or stolen laptop or phone.

Encoding is not encryption. Base64, for example, only changes how data is represented; anyone can decode it. Our Base64 decoder shows this clearly — if you can decode it without a key, it was never secret.

What is post-quantum cryptography?

Post-quantum cryptography is cryptography designed to resist attacks from quantum computers. A large enough quantum computer could break RSA and elliptic-curve cryptography with Shor's algorithm, so NIST ran a public competition and finalized new standards in August 2024.

The first three standards are FIPS 203 (ML-KEM, for key encapsulation), FIPS 204 (ML-DSA, for digital signatures), and FIPS 205 (SLH-DSA, a hash-based signature standard). ML-KEM and ML-DSA are lattice-based; SLH-DSA relies only on hash functions, as a conservative backup if lattice assumptions ever fail.

Symmetric cryptography and hashing are far less affected. Grover's algorithm only halves their effective strength, so AES-256 drops to about 128 bits of effective security — still out of reach. The migration work therefore focuses on key exchange and signatures, not on bulk encryption.

Classical vs post-quantum: what changesWhat breaksQuantum attackReplacementRSA, ECDH key exchangeShor's algorithmML-KEM (FIPS 203)RSA, ECDSA signaturesShor's algorithmML-DSA (FIPS 204)AES-256, SHA-256Grover's (halves strength)Keep; use 256-bit keysRule of thumbReplace public-key math first.
Post-quantum migration focuses on key exchange and signatures. Illustration by Cysoro.

What are the most common cryptography mistakes?

The most common mistakes are inventing your own cipher, using a broken algorithm, reusing keys, and storing secrets in code. Every one of them has broken real systems, even when the underlying mathematics was sound.

  • Rolling your own crypto. Use vetted libraries such as libsodium or your platform's standard library, never a cipher you designed.
  • Using broken algorithms. MD5 and SHA-1 are broken for security use, and DES is long deprecated. Use SHA-256 or SHA-3, and AES.
  • Hard-coding keys. Keys in source code, config files, or mobile apps leak. Use a secrets manager or key management service.
  • Encrypting without authenticating. Encryption hides data but does not prove it was unchanged. Use authenticated encryption such as AES-GCM.
  • Ignoring key rotation and revocation. Keys and certificates must be replaceable when they leak or expire.

For a practical check, run our SSL checker on your own site: it flags old TLS versions and weak configurations in seconds.

The bottom line

Cryptography is not magic, and it is not a single tool. It is a small set of well-tested building blocks — symmetric encryption, asymmetric key exchange, hashing, and signatures — combined correctly to protect real systems.

Your job is not to design new mathematics. It is to use the standards, keep software updated, protect your keys, and choose tools that apply cryptography properly. Start by checking that your own site uses modern TLS with our free SSL checker.

Frequently asked questions

What is cryptography in simple terms?

Cryptography is the use of mathematics to protect information. It scrambles messages so only the intended reader can read them, creates fingerprints that show if data was changed, and proves who sent a message. You use it every time you visit an HTTPS website or unlock your phone.

What is cryptography in cyber security?

In cyber security, cryptography is the foundation for keeping data private, proving identity, and detecting tampering. It secures passwords, network traffic, files, software updates, and payments, and it underpins tools such as TLS, VPNs, encrypted messaging, and digital certificates.

What is the difference between cryptography and encryption?

Encryption is one part of cryptography. Cryptography is the wider field, covering encryption, hashing, digital signatures, and key exchange. Encryption reversibly scrambles data; hashing is one-way; a digital signature proves authenticity.

What is symmetric vs asymmetric cryptography?

Symmetric cryptography uses one shared secret key to encrypt and decrypt, and it is fast. Asymmetric cryptography uses a public key and a private key, and it solves the problem of sharing a secret over an open channel. Real systems use both together.

Is hashing the same as encryption?

No. Encryption can be reversed with the right key, while hashing is one-way and cannot be reversed to recover the original data. A hash lets you check whether data changed, but it does not hide data that must be read again later.

What is the strongest encryption algorithm?

AES-256 is the standard for symmetric encryption and is approved by NIST in FIPS 197. For public-key work, the modern answer is moving toward NIST post-quantum standards such as ML-KEM and ML-DSA. Strength also depends on key management, not just the algorithm name.

Can quantum computers break cryptography?

A large enough quantum computer could break RSA and elliptic-curve cryptography using Shor's algorithm, which is why NIST finalized post-quantum standards in 2024. Symmetric encryption and hashing are far less affected, because Grover's algorithm only halves their effective strength.

Do I need to understand cryptography to stay safe online?

No. You need to use tools that apply it correctly: HTTPS websites, updated software, a password manager, and passkeys or security keys where available. Understanding the basics helps you spot bad advice, such as a service that stores passwords in plain text.

Sources

  1. NIST — FIPS 197: Advanced Encryption Standard (AES)
  2. NIST — FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism Standard
  3. Encryption Consulting — What Is Cryptography in Security?
  4. Daily Debian — Symmetric vs Asymmetric Encryption Explained
  5. MyCyberSecurityPath — Cryptography Basics
  6. Lattices.io — Post-Quantum Cryptography: Why Lattices Resist Shor
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against NIST FIPS 197 and FIPS 203, NIST SP 800-175B guidance, and RFC 8446 for TLS 1.3.

How we write and fact-check →

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free