Pick an algorithm, type a message and follow what happens to it. The steps show the first and last part of each calculation; the repetitive middle is left out.
CRC-32 checksum
A checksum tells whether data arrived intact without comparing it in full with the original. The sender computes a short number, the receiver computes it again, and if both match, most likely nothing was damaged on the way. ZIP files, PNG images and Ethernet use it.
CRC-32 treats the message as one huge binary number and divides it by a fixed polynomial; the 32-bit remainder is the result. In practice it goes byte by byte with a precomputed table, which is why it is so fast.
Weaknesses
It guards against accidental errors, not against someone changing the message on purpose. Anyone can adjust four bytes so that a fake message has the same CRC as the real one, as the last step shows. Spotting deliberate changes takes a cryptographic hash or, better, a signature.
For years MD5 was the general-purpose hash: it turns any message into 128 bits, always the same ones for the same message and with no visible relation to it. It was used to store passwords, check downloads and sign certificates.
It pads the message to blocks of 512 bits and mixes each one in 64 steps of additions, rotations and logic functions over four 32-bit registers.
Weaknesses
Since 2004 collisions, two different messages with the same MD5, can be produced in seconds on an ordinary computer. In 2012 the Flame malware used an MD5 collision to forge a Microsoft certificate. It is also so fast that a graphics card tries billions of passwords per second. Today it is only good as a checksum against accidental errors, like a CRC.
SHA-256 holds up a good part of the internet: HTTPS certificates, software signatures, Git and Bitcoin. It produces 256 bits and, unlike MD5, nobody has found a collision or a way back from the result to the message.
It works much like MD5, with eight registers, 64 rounds and a message schedule in which every new word depends on four earlier ones. Changing a single bit of the message changes about half the bits of the result.
Weaknesses
It is a secure hash but a fast one, so on its own it is not enough to store passwords: an attacker can try billions of candidates per second. That is what deliberately slow algorithms such as Argon2id are for. A quantum computer would only halve its strength in bits (Grover’s algorithm), which still leaves a huge margin.
SHA-3 is the standard NIST chose in 2015 through an open competition, not because SHA-256 was broken but to have an alternative built in a completely different way, in case a weakness ever shows up in the SHA-2 family.
Instead of chained blocks it uses a “sponge”: a 1600-bit state that absorbs the message in parts and is then squeezed for the result. Each round applies five steps, θ, ρ, π, χ and ι; only χ is non-linear. The same sponge builds SHAKE128 and SHAKE256, which ML-KEM and ML-DSA use inside.
Weaknesses
No practical weaknesses are known. Like SHA-256, it is too fast to store passwords.
To store passwords you want a hash that is slow on purpose, not a fast one. Argon2id won the Password Hashing Competition in 2015 and is what OWASP recommends today. Besides time it demands memory: every attempt fills several megabytes in which each block depends on earlier ones.
The salt is a random value stored next to the result. Two people with the same password get different results, and an attacker has to go after each account separately. What the server stores is the whole line you see at the end, with algorithm, cost, salt and result, never the password.
Change the memory and watch the time grow. For you it is an instant at login; for someone trying a billion passwords it is an enormous cost.
Weaknesses
A short or common password is still guessed, just more slowly. The memory here is small so the demonstration runs on any device; servers use at least 19 MiB, as OWASP recommends.
Julius Caesar encrypted his military messages by shifting every letter a fixed number of places along the alphabet. With 3, A becomes D and “hola” becomes “krod”. To decrypt, shift back.
Weaknesses
There are only 25 possible keys, so trying them all is enough, as the last step shows; only one gives readable text. Besides, a letter always encrypts the same way, so the language’s most frequent letters give the key away.
Vigenère historical cipher
Vigenère uses a word as the key, and each letter of the key says how far to shift the matching letter of the message. The same letter of the message can encrypt differently depending on its position, which earned it the name “the indecipherable cipher” for some three centuries.
Weaknesses
The key repeats. In the 19th century Charles Babbage and Friedrich Kasiski worked out how to find its length from repeated sequences in the ciphertext. With the length known, the text splits into columns, and each column is a plain Caesar that falls to frequency analysis. The last step shows those columns.
AES-256-GCM symmetric encryption
AES has been the standard symmetric cipher since 2001: the same key encrypts and decrypts. HTTPS, WPA2 and WPA3 Wi-Fi, encrypted disks and almost every messaging app use it. It works on 16-byte blocks in a 4×4 grid that goes through 14 rounds of substitution, shifting, mixing and adding the key.
GCM is the mode it runs in: AES encrypts a counter, the result is XORed with the message, and at the end a tag is computed that detects any change. The nonce is a number that must never repeat with the same key; a new one is generated every time here, which is why the result changes even when the message does not.
Weaknesses
With a random 256-bit key there is no practical attack, not even with quantum computers. The danger is misuse: repeating a nonce with the same key lets an attacker recover messages and forge tags. The deeper problem is another one: how do two people who have never met share the key? That is what public-key cryptography is for.
ChaCha20-Poly1305 does the same job as AES-GCM with a different construction. Designed by Daniel J. Bernstein, it uses only additions, rotations and XORs (“ARX”), so it is fast even on phones without special AES instructions. TLS 1.3, WireGuard and SSH use it.
ChaCha20 mixes a grid of 16 words (constants, the key, a counter and the nonce) over 20 rounds and produces a stream of bytes that is combined with the message. Poly1305 computes the tag by evaluating a polynomial modulo 2¹³⁰ − 5.
Weaknesses
No practical attack is known, quantum computers included. As with AES-GCM, a nonce must never repeat with the same key.
RSA (1977) was the first practical public-key cipher. Anyone can encrypt with the public key, but only the holder of the private key can decrypt. Its security rests on multiplying two huge primes being easy and splitting them apart again not.
Encrypting raises the message, turned into a number, to the power e modulo n; decrypting raises the result to d. OAEP is random padding applied first, so the same message never gives the same result. A 2048-bit key fits only 190 bytes; in practice RSA encrypts an AES key, and AES encrypts the data.
Weaknesses
A large enough quantum computer would factor n with Shor’s algorithm and get the private key. That is why NIST proposes to stop allowing RSA by 2035. And someone can store encrypted messages today to decrypt them once such a computer exists.
X25519 solves sharing a key without sending it. Alice and Bob each pick a secret number and publish the result of multiplying a point on an elliptic curve by it; each then multiplies the other’s result by their own secret. Both reach the same point, and someone who only saw the public values cannot compute it.
It is the most widely used key exchange today, in TLS 1.3, Signal, WhatsApp and SSH. Here the shared secret becomes an AES-256-GCM key that encrypts your message.
Weaknesses
Like RSA, Shor’s algorithm would break it on a large quantum computer. That is why browsers already combine it with ML-KEM (X25519MLKEM768), which is what the next category shows.
ML-KEM (FIPS 203, 2024) is the post-quantum replacement for key exchange. Its security comes from a lattice problem called “learning with errors”. The public key is a random matrix A multiplied by a secret of small numbers, plus a little noise. Without the noise it would be a system of equations that is easy to solve; with it, nobody knows an efficient way, quantum computers included.
Alice picks 32 random bytes, hides them in polynomials using Bob’s public key and sends him the result. Bob uses his secret to remove almost all the noise; every coefficient ends up near 0 or near 1665, and rounding recovers the bits. From there both derive the same 32-byte secret, which here encrypts your message with AES-256-GCM.
Weaknesses
It is young next to RSA and elliptic curves, so today it is used together with X25519: if either one falls, the other still protects. Keys and ciphertexts are much larger, 1184 and 1088 bytes against 32 for X25519.
ML-DSA (FIPS 204, 2024) is the post-quantum digital signature. A signature proves that a message comes from whoever holds the private key and that nobody changed it; anyone with the public key can check it.
Signing picks a random vector y and shifts it by the secret according to a challenge c that comes from a hash of the message. If the result z could reveal something about the secret, because it is too large, it is thrown away and tried again; on average it takes about five attempts. Verifying repeats the calculation with the public key and checks that the same challenge comes out. At the end you can see that changing one character of the message is enough for the signature to fail.
Weaknesses
Signatures take 3309 bytes against 64 for Ed25519, which weighs on certificates and protocols with many signatures. Like ML-KEM it is recent, so the transition is being made carefully and in stages.