Cryptography is the mathematics of protecting information and proving digital relationships in the presence of adversarial uncertainty. It asks how messages can remain confidential, how tampering can be detected, how identities or statements can be authenticated, and how strangers can establish trust without exposing the secret material that makes the trust possible.
The subject sits at a meeting point of number theory, abstract algebra, probability, combinatorics, algorithms and information theory. Mathematics supplies structures that are easy to use in one direction yet difficult to reverse without special information. Computer science supplies algorithms and complexity assumptions. Engineering supplies protocols, implementations and operational controls.
Cryptography is not the same as complete cybersecurity. A mathematically sound encryption scheme cannot protect a password pasted into a phishing page, a private key copied from an insecure device or a system that authenticates the wrong person. Cryptography protects specified relationships under specified assumptions; system security has to protect the whole pathway around them.
Series route: Mathematics Learning Hub → How Mathematics Works → Cryptography. Important foundations include Number Theory, Abstract Algebra, Probability and Information Theory.
1. Cryptography begins with a threat model
Before choosing a mathematical construction, define what needs protection and what an adversary is assumed able to observe or alter.
Does the adversary see encrypted messages? Can they inject new messages? Can they choose messages for encryption? Can they steal a device? Can they learn old keys later? Different capabilities create different security goals.
A system can be secure against passive eavesdropping and insecure against active modification. “Encrypted” therefore does not mean “protected against everything.”
2. Confidentiality, integrity and authenticity are separate properties
Confidentiality hides content from unauthorised readers. Integrity detects unauthorised changes. Authenticity gives evidence about who or what generated a message under the protocol’s assumptions.
Encryption alone may provide confidentiality without protecting integrity. A secure protocol often combines several mechanisms so ciphertext cannot be modified unnoticed.
Digital signatures provide authenticity and integrity evidence without keeping the signed message secret.
3. Keys separate public algorithms from secret control
Modern cryptography generally assumes the algorithm can be public. Security should depend on secret keys or other explicitly protected values, not on hoping nobody discovers how the algorithm works.
This makes systems auditable and replaceable. A widely studied algorithm with protected keys can be stronger than an obscure algorithm whose secrecy is the only defence.
4. Symmetric encryption uses shared secret keys
In symmetric encryption, sender and receiver share secret key material. Encryption transforms plaintext into ciphertext; decryption uses the secret to recover the original message.
Symmetric methods can be computationally efficient and are commonly used for bulk data protection.
The operational challenge is key distribution: how do communicating parties obtain the shared secret securely before using it?
5. One-time pads show information-theoretic secrecy
A correctly used one-time pad combines a message with a truly random key of equal length that is never reused and remains secret.
Under those strict conditions, ciphertext reveals no information about the plaintext in the information-theoretic sense.
The price is severe key-management demand. The key must be as long as the message, uniformly random, shared securely and used once. The example demonstrates a fundamental trade-off rather than a universal practical solution.
6. Computational security relies on hardness assumptions
Most practical cryptography does not achieve secrecy against unlimited computation. It aims for security against computationally bounded adversaries under mathematical hardness assumptions.
The distinction matters. A statement such as “breaking this would require infeasible computation under current assumptions” is different from “the ciphertext contains zero mathematical information about the plaintext.”
7. Modular arithmetic creates finite arithmetic worlds
Many cryptographic constructions work modulo an integer, where numbers are grouped by their remainders.
Congruences, inverses, exponentiation and prime-number structure make it possible to construct transformations with useful asymmetry.
The detailed mathematical foundation is developed in How Mathematics Works | Number Theory.
8. Public-key cryptography splits the key roles
Public-key systems use related but different key roles. One key can be published while another remains private.
This allows strangers to perform useful secure operations without first sharing the same secret key through a separate secure channel.
Public keys still need authentic binding to identities. A correct public-key algorithm cannot help if the user is tricked into trusting an attacker’s public key as belonging to the intended recipient.
9. RSA demonstrates arithmetic asymmetry
RSA builds a public-key structure using modular exponentiation and arithmetic related to a modulus formed from large primes.
The public and private exponents are related through modular arithmetic, while practical security depends on computational assumptions associated with recovering private structure from public information.
The important lesson is structural: a mathematical operation can be easy to compute forward while inversion without privileged information is believed computationally difficult at appropriate parameter sizes.
10. Diffie–Hellman separates agreement from prior secrecy
Diffie–Hellman-style key agreement allows two parties to combine private choices with exchanged public values and derive shared key material.
The protocol relies on group structure and hardness assumptions related to discrete logarithms.
Unauthenticated key agreement alone does not establish who is on the other end. Authentication must be integrated when identity matters.
11. Elliptic curves provide another algebraic group
Points on suitable elliptic curves over finite fields form groups with efficient operations.
Cryptographic schemes can use the difficulty of reversing repeated group operations under appropriate parameters.
This creates a direct bridge to Algebraic Geometry and abstract algebra.
12. Hash functions compress inputs into fixed-size outputs
A cryptographic hash maps arbitrary-length input to a fixed-length digest.
Desired properties include resistance to finding a preimage for a chosen digest, a second input matching a given input’s digest and any pair of distinct inputs sharing a digest.
Because the output space is finite and the input space is much larger, collisions must exist mathematically. Security concerns the computational difficulty of finding useful collisions, not their logical impossibility.
13. The birthday phenomenon changes collision scales
For an n-bit hash behaving ideally, collision search scales roughly around 2^{n/2} trials rather than 2^n because any matching pair among many samples counts.
This is a probability and combinatorics effect analogous to birthday coincidences in a group.
Digest length therefore protects different security goals at different effective scales.
14. Message authentication codes protect integrity with a shared secret
A message authentication code uses secret key material to produce an authentication tag for a message.
A receiver who shares the key can verify that the message and tag match under the scheme.
Unlike a public digital signature, verification typically requires the same shared secret or related secret material.
15. Digital signatures reverse the public/private roles
A digital-signature scheme lets a private key produce a signature and a corresponding public key verify it.
The signature can provide evidence that someone possessing the private signing key authorised the signed data under the protocol.
The conclusion is about key possession and protocol validity. Connecting a key to a legal or human identity requires certificate, organisational and procedural systems around the mathematics.
16. Encryption and signing answer different questions
Encryption asks who can read. Signatures ask who can verify origin and integrity.
A confidential unsigned message may be readable only by the recipient but lack strong origin evidence. A publicly readable signed document may have excellent authenticity while no confidentiality at all.
Protocols combine properties according to the real task.
17. Randomness is a cryptographic resource
Keys, nonces, salts and protocol challenges often require unpredictable or unique values.
Weak randomness can collapse otherwise strong mathematics because an adversary may predict secret material or force repeated values that the scheme assumes are fresh.
Random-number generation is therefore part of the cryptographic system boundary.
18. Nonces prevent dangerous reuse patterns
A nonce is a value intended to be used once within a specified protocol context.
Some encryption modes require nonce uniqueness rather than secrecy. Reuse can destroy important security properties.
The exact requirement belongs to the construction. “Random” and “unique” are not interchangeable words.
19. Password hashing is different from ordinary hashing
Human passwords usually come from a small and highly nonuniform space. Fast general-purpose hashing alone therefore makes large-scale guessing relatively cheap.
Password-storage systems use specialised password-hashing or key-derivation functions designed to make each guess deliberately expensive, together with salts that prevent identical passwords from sharing identical stored representations.
This is a systems lesson: the right mathematical primitive depends on the source distribution and threat model.
20. Authentication protocols need freshness
If a valid old authentication message can simply be replayed, integrity of that old message does not prove freshness.
Protocols use challenges, timestamps, counters or nonces so the verifier can distinguish a current response from a recorded past one.
Time and sequence therefore become cryptographic state variables.
21. Authenticated encryption combines confidentiality and integrity
Modern authenticated-encryption constructions protect ciphertext confidentiality while also allowing the receiver to detect unauthorised modification.
They can also authenticate associated metadata that remains visible but must not be altered unnoticed.
Using a well-designed combined construction reduces the risk of composing encryption and authentication incorrectly.
22. Protocol composition is where many failures occur
Secure mathematical primitives do not automatically produce a secure protocol when combined.
Key reuse, message-format ambiguity, missing domain separation, incorrect error handling or unauthenticated metadata can create vulnerabilities around sound primitives.
This is why cryptographic engineering prefers standard, reviewed protocols over improvised combinations.
23. Security proofs are conditional arguments
A reduction proof may show that if an adversary can break a scheme under a defined game, then that adversary could also solve another problem believed to be hard.
This is not an unconditional proof that no attack exists. The guarantee depends on the hardness assumption, adversary model, parameters and correctness of the reduction.
The precision is a strength: it exposes exactly where trust enters the mathematical chain.
24. Perfect secrecy and computational secrecy should not be conflated
Perfect secrecy is an information-theoretic property: observing ciphertext does not change the message distribution under the model.
Computational secrecy allows statistical information to exist in principle but aims to make exploitation infeasible for realistic adversaries.
The Information Theory branch explains the first type of limit; complexity assumptions create the second.
25. Post-quantum cryptography changes the hardness assumptions
Large fault-tolerant quantum computers would alter the security of some widely used public-key assumptions, particularly those based on integer factorisation and discrete logarithms.
Post-quantum cryptography therefore uses mathematical problem families believed to resist known classical and quantum attacks under suitable parameters.
The transition is not “quantum makes all cryptography useless.” Symmetric methods and hash functions are affected differently, and new public-key constructions rely on different mathematics.
26. Lattice-based cryptography introduces high-dimensional geometry
A lattice is a discrete set of points generated by integer combinations of basis vectors in a vector space.
Some post-quantum constructions rely on computational problems related to finding short or nearby lattice vectors and structured noisy linear equations.
This creates a bridge from cryptography back to linear algebra, geometry, probability and discrete mathematics.
27. Zero-knowledge proofs separate knowledge from disclosure
A zero-knowledge proof system can allow one party to convince another that a statement is true or that certain secret knowledge is possessed without revealing the secret itself, beyond what the accepted statement implies under the formal model.
The concept shows that verification and disclosure are distinct dimensions. A system need not reveal every underlying witness merely because it needs to establish a fact about that witness.
28. Secret sharing distributes trust
Threshold secret-sharing schemes divide secret information into shares so that a required number of participants can reconstruct it while smaller coalitions learn nothing under the scheme’s assumptions.
The mathematics can reduce dependence on one secret holder, but operational security still depends on protecting shares and identifying participants correctly.
29. A worked mechanism: modular inverse
Consider the congruence 3x≡1 mod 7.
- We seek a number x whose product with 3 leaves remainder 1 modulo 7.
- 3×5=15.
- 15≡1 mod 7.
- Therefore 5 is the multiplicative inverse of 3 modulo 7.
Public-key cryptography uses much larger and richer modular structures, but this elementary calculation shows how “division” can be reconstructed inside finite arithmetic when an inverse exists.
30. A worked mechanism: collision counting
Suppose a toy hash has only 100 equally likely possible digest values.
- With one input, no collision exists yet.
- With many inputs, every pair is a potential collision pair.
- The number of pairs among n inputs is n(n−1)/2.
- Collision probability therefore becomes substantial well before 100 independent samples.
The toy model explains why collision resistance scales with roughly half the digest length in the exponent for idealised brute-force search.
31. Common cryptography failure modes
- Algorithm secrecy: relying on nobody discovering the design rather than protecting keys.
- Encryption-is-everything thinking: ignoring integrity, authenticity and replay protection.
- Nonce reuse: violating a construction’s freshness requirements.
- Weak randomness: generating predictable secrets.
- Key-identity confusion: possessing a public key without authenticating whose key it is.
- Primitive composition errors: combining secure components into an insecure protocol.
- Proof overreach: treating a conditional reduction as security against every adversary and implementation failure.
- Operational key leakage: protecting mathematics while exposing the secrets around it.
32. Cryptography and number theory
Prime numbers, modular arithmetic, finite fields and discrete logarithms provide classical public-key structures.
Number theory therefore supplies arithmetic worlds where one direction of computation can have different practical difficulty from the reverse.
33. Cryptography and abstract algebra
Groups, rings and fields formalise the operations used by many schemes.
The structural view matters because security often depends not on ordinary integer size but on the algebraic properties of the group or field in which the operation occurs.
34. Cryptography and probability
Security games, randomized encryption, collision analysis and error probabilities all use probabilistic reasoning.
A cryptographic guarantee may state that an adversary’s advantage is negligible rather than literally zero. Probability makes that distinction precise.
35. Cryptography as a mathematical machine
Threat Model → Security Goal → Algebraic/Probabilistic Primitive → Key and Randomness Rules → Protocol Composition → Security Argument → Implementation/Identity Check → Operational Verification.
The machine fails when the threat model omits an important capability, secrets are mishandled, freshness requirements are violated, keys are bound to the wrong identities or a proof about one primitive is extended to the surrounding system without justification.
36. What mastery looks like
- distinguish confidentiality, integrity, authenticity and freshness;
- explain symmetric and public-key roles without confusing them;
- use modular arithmetic and algebraic structures conceptually;
- understand why hashes can collide yet remain useful;
- separate information-theoretic from computational security;
- treat randomness and nonce requirements as part of the mathematics;
- interpret security proofs conditionally and precisely;
- recognise that post-quantum cryptography changes assumptions rather than abolishing cryptography;
- protect the protocol and operational pathway around the primitive.
37. Conclusion
Cryptography works by creating mathematical relationships that authorised participants can use efficiently while unauthorised inference or forgery remains impossible or computationally infeasible under declared assumptions. Number theory provides modular structure. Algebra supplies groups and fields. Probability defines adversarial advantage. Information theory defines stronger secrecy limits. Algorithms turn the structure into usable protocols.
Cryptography does not make trust unnecessary. It moves parts of trust from hidden promises into explicit mathematical and operational contracts that can be tested.
How Mathematics Works | Batch 08
- How Mathematics Works | Control Theory
- How Mathematics Works | Operations Research
- Cryptography — this article
- How Mathematics Works | Mathematical Physics
Return to the Mathematics Learning Hub or the How Mathematics Works root.