What is Cryptography?
How It Works, Types and Examples

Cryptography is the science of protecting information by turning it into a secret code that only the right people can read. It uses keys to lock and unlock data, and it proves that a message is real and unchanged. It keeps passwords, payments and files safe every day.

Short Answer Cryptography is the science of protecting information by turning it into a secret code that only the right people can read. It also proves that data is real and has not been changed. For example, when you see the padlock in your browser, cryptography keeps your password and card details hidden from anyone who tries to spy on them on the way.

What is Cryptography?

In simple words, cryptography means writing data in a secret code. Today, computers do this work for us. The word comes from two old Greek words that mean “hidden” and “writing”. In the past, armies and traders used it to hide letters. Today, it protects almost everything you do on a phone or computer.

In cyber security, cryptography does two big jobs. First, it keeps data private, so a thief who grabs it sees only nonsense. Second, it proves things: that a message really came from the sender, and that no one changed it on the way. Because of this, cryptography sits under passwords, online banking, email, Wi-Fi and cloud storage.

Think of a locked box with a special key. Anyone can carry the box, but only the person with the right key can open it. In the same way, cryptography lets data travel across the open internet safely.

Key Words to Know

  • Plaintext: the normal, readable data, such as a letter or a spreadsheet.
  • Ciphertext: the scrambled version that looks like random letters and numbers.
  • Algorithm: the fixed set of math steps that does the scrambling. In fact, most good algorithms are public.
  • Key: a long number that the algorithm uses to lock or unlock data. The key that unlocks the data must stay secret. Without it, no one can unscramble the data.
  • Encryption and decryption: encryption turns plaintext into ciphertext. Then decryption turns it back.
  • Hash: a short “fingerprint” of any data. If even one letter changes, the fingerprint changes too.
  • Digital signature: a code made with the sender’s private key and attached to a file or message. After that, anyone can check it with the sender’s public key. It proves who sent the data and that no one changed it.

How Does Cryptography Work?

Every cryptography method follows the same basic idea. You take readable data, mix it with a key using an algorithm and get ciphertext. Then the receiver uses the right key to turn it back into readable data. The algorithm can be public, because the safety comes from keeping the key secret.

  1. Start with plaintext: for example, a file of staff salaries.
  2. Pick a key: the computer creates a long, random secret number.
  3. Encrypt: the algorithm mixes the file with the key, so the result is ciphertext.
  4. Send or store: the ciphertext travels by email or sits on a server. As a result, anyone who steals it sees only noise.
  5. Decrypt: the receiver uses the right key, and the algorithm turns the ciphertext back into the original file.
Salary file locked with a secret key, sent as scrambled text, then unlocked by the payroll partner
The algorithm can be public, because the secret key is what keeps the file safe.

A Simple Office Example

For example, the HR team at a Chennai company must send the monthly salary file to the payroll partner. If they attach the file as it is, anyone who reads that email can see every salary. So instead, HR encrypts the file before sending it. HR and the payroll partner set up a shared key earlier, in a safe way and never by plain email. So only the partner can open the file. HR also adds a digital signature, which works like a sealed stamp. Now the partner knows the file truly came from HR and that no one changed a single number.

What Are the Types of Cryptography?

There are three main types of cryptography. Each one solves a different problem, and most real systems use all three together. The names below are open standards, so anyone can study them and check that they are safe.

Symmetric Encryption: One Shared Key

Here, the same key locks and unlocks the data. It is very fast, so it suits large files, disks and databases. However, both sides need the same secret key first, and sending it safely is the hard part. Asymmetric encryption, explained next, solves this. AES, the Advanced Encryption Standard, is the most common example.

Asymmetric Encryption: A Key Pair

This type is also called public key cryptography. Instead, each person gets two linked keys. The public key can be shared with anyone, while the private key stays secret. Data locked with the public key opens only with the private key. Because of this, two strangers can start a safe conversation without meeting first. For instance, RSA is a well-known method. Elliptic curve cryptography (ECC) is a newer public key method. It gives the same safety with shorter keys, so phones and websites use it widely. Public key methods are slower, so systems often use them only to agree on a symmetric key safely, then switch to the faster symmetric key. The key pair also makes digital signatures possible. The sender signs with the private key, and anyone can check the signature with the public key.

Hash Functions

A hash function turns any data into a short fingerprint of fixed length. Unlike encryption, you cannot turn a hash back into the original data. So hashes help you check data. They cannot keep it secret. For instance, websites store a hash of your password instead of the password itself. For this job they use special slow hash methods built for passwords. SHA-256 is a widely used hash standard for checking files and data.

What Does Cryptography Protect?

Cryptography has four main goals. The first two match parts of the CIA triad, the basic model of information security.

  • Confidentiality: only the right people can read the data. Encryption handles this.
  • Integrity: the data has not been changed. Hashes show even the smallest edit.
  • Authentication: you can trust who you are talking to. For example, a website proves its identity with a digital certificate.
  • Non-repudiation: a sender cannot later deny sending a message, because their digital signature is on it.

In short, encryption keeps secrets, while hashes and signatures prove that data is genuine.

Where is Cryptography Used Every Day?

You use cryptography many times a day without noticing. In network security, it protects data as it moves between computers. Here are some common places:

  • Websites: the padlock and “https” in your browser mean TLS (Transport Layer Security) is at work. In short, TLS encrypts what you send. It also checks the site’s certificate, a digital ID card that proves the site is really who it claims to be.
  • Wi-Fi: Wi-Fi protected with a password encrypts traffic, so a neighbor cannot read it. However, open public Wi-Fi often does not.
  • Remote work: a virtual private network (VPN) builds an encrypted tunnel from a laptop to the office.
  • Passwords: good systems store only password hashes. If hackers steal the list, they still have to guess each password, one try at a time. This is called a brute force attack, and long passwords make it very slow.
  • Payments: banking and UPI apps use encryption and signatures to protect each payment.
  • Laptops and phones: disk encryption keeps files unreadable if a device is lost or stolen.
  • Software updates: digital signatures prove an update came from the real maker.

Blockchain and Digital Money

A blockchain is a shared record book that many computers keep together. It uses hashes to link each page of records to the one before, so no one can quietly change an old entry. Digital signatures make sure only the owner can approve a payment. In fact, the “crypto” in cryptocurrency comes from cryptography.

Cryptography vs Encryption vs Hashing

People often mix up these words. Cryptography is the whole field. Encryption and hashing are two tools inside it. To learn more about the first tool, read our page on data encryption.

Question Cryptography Encryption Hashing
What is it? The whole science of secret codes and proof One method that hides data One method that fingerprints data
Main goal Privacy, integrity and trust Privacy Integrity
Can you reverse it? Depends on the tool Yes, with the right key No
Uses a key? Usually Yes No
Office example Securing a whole payroll system Locking the salary file Storing staff passwords safely
Tree showing symmetric encryption, asymmetric encryption and hashing as branches, with the goal each one serves
Encryption hides data, hashing proves it is unchanged, and key pairs plus hashing create digital signatures.

Three related words often come up: cryptology, cryptanalysis and steganography. The FAQs below explain each one in a few lines.

Talk to an ExpertIs your sensitive data locked with the right keys? Talk to our team about cryptography.

What Will Quantum Computers Change?

A quantum computer is a new kind of machine that solves some math puzzles in a completely different way from today’s computers. Large, working quantum computers do not exist yet. However, experts expect that a big enough one could break today’s public key methods, such as RSA. Symmetric methods like AES face a smaller risk, and longer keys, such as 256-bit AES, are expected to keep them safe.

That is why NIST, the US standards agency, has prepared new methods, called post-quantum cryptography, built to resist quantum attacks. In August 2024, NIST published its first three post-quantum standards. One, called ML-KEM (FIPS 203), is for sharing keys safely. The other two, ML-DSA (FIPS 204) and SLH-DSA (FIPS 205), are for digital signatures. Then, in March 2025, NIST picked a backup method called HQC. Attackers can copy encrypted data today and wait to read it once quantum computers arrive. So ask your IT team or partner now to list which systems use public key methods, such as RSA.

Keeping Keys Safe in the Cloud

Strong algorithms do not help if someone steals the key. So key management matters as much as the math. It means creating keys, storing them safely, replacing them with new ones on a schedule and retiring old ones. Both AWS and Microsoft Azure offer services for this, as part of wider cloud security.

  • AWS Key Management Service (AWS KMS): it creates and controls the keys used to encrypt and sign data. Hardware security modules, which are tamper-resistant key safes, protect the keys, and the keys never leave the service unencrypted.
  • Azure Key Vault: it stores and controls access to keys, passwords and TLS certificates. Users and apps sign in through Microsoft Entra ID, Microsoft’s sign-in service. On the Premium tier, a higher service level, keys stay inside hardware security modules.

In both cases, the business decides who can use each key, and logs show every use. This fits into wider data security, where cryptography is one layer among several.

Frequently Asked Questions About Cryptography

What does cryptography involve?

Cryptography involves three main parts. First, an algorithm, which is a public set of steps for scrambling data. Second, keys, which are long secret numbers that lock and unlock the data. Third, key management, which means creating, sharing, storing and retiring those keys safely. Together, these parts keep data private and prove that it is genuine and unchanged.

What is the difference between cryptography and steganography?

Cryptography scrambles a message so no one else can read it, but people can still see that a secret message exists. Steganography hides the message itself, for example inside a normal photo or sound file, so no one even suspects it is there. Some people use both together. However, businesses rely mainly on cryptography, because it rests on tested, public standards.

What is the difference between cryptology and cryptanalysis?

Cryptology is the full study of secret codes. It has two sides. Cryptography builds the methods that hide and protect data. Cryptanalysis tries to break those methods and find their weak spots. Both sides help each other, because experts trust a method only after many people have tried hard to break it and failed.

Is cryptography the same as cybersecurity?

No. Cybersecurity is the wide practice of protecting computers, networks and data from attacks. Cryptography is one important tool inside it. For example, cybersecurity also covers firewalls, staff training, updates and access rules. Strong codes alone cannot stop someone who tricks a staff member into sharing a password, so companies need both.

Is cryptography the same as cryptocurrency?

No. Cryptography is the science of codes and proof, and it is far older than any digital money. Cryptocurrency is one use of it. Digital coins rely on hashes to link records and on digital signatures to approve payments. So every cryptocurrency depends on cryptography, but most cryptography has nothing to do with money. It protects websites, email and files every day.

Is cryptography the same as blockchain?

No. Blockchain is one system that uses cryptography as a building block. Cryptography itself is much older and wider. Inside a blockchain, hashes link each block of records to the one before, so old entries cannot change quietly. Digital signatures show who approved each entry. Thousands of other systems, such as websites, email and payment apps, also use cryptography.

What math does cryptography use?

Modern cryptography uses number puzzles that are easy to do one way but very hard to undo. For example, multiplying two huge prime numbers is quick, but finding those two primes from the answer takes ordinary computers an extremely long time. RSA relies on this idea. You do not need to know this math to use cryptography, because tested standards handle it for you.

What is a cipher?

A cipher is the method, or set of steps, used to scramble and unscramble a message. A very old example shifts every letter three places, so A becomes D. That cipher is easy to break. Modern ciphers, such as AES, use long secret keys and many rounds of mixing, so even today’s fastest computers cannot break them in any useful time.
Use CaseProtect Sensitive and Confidential Business Data

References

  1. Post-quantum standards: NIST, NIST Releases First 3 Finalized Post-Quantum Encryption Standards
  2. AWS key management: AWS, AWS Key Management Service Developer Guide
  3. Azure key management: Microsoft Learn, Azure Key Vault Overview
Stay Updated

Get the Latest Terms & Insights.

New encyclopedia terms, threat intelligence, and architecture decisions, by email.

Book a Consultation

A practice principal will contact you within 1 business day.

Thank you! A Signisys principal will be in touch within 1 business day.