Fireship · @fireship
7 Cryptography Concepts EVERY Developer Should Know
Uploaded November 1, 2021 · Length 11:55
Summary
Learn 7 essential cryptography concepts for developers, including hashing, encryption, and signing, and implement them in Node.js with hands-on examples.
- cryptography concepts
- node js crypto
- hashing passwords
- encryption
- digital security
- web development
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
Cryptography is terrifying. It's based on math that most of us don't understand, yet is the one thing that makes the internet secure.
- 0:06
Without the mysterious art of cryptography, there would be no secrets and no privacy in the digital world.
- 0:11
Your emails, bank records, and browsing history would be easily hackable.
- 0:15
Computers, by design, do exactly what we tell them to do, but sometimes we don't want them to do certain things, like expose private data.
- 0:22
I'm sorry, Dave. I'm afraid I can't do that.
- 0:25
Cryptography can take some useful bytes of data, then scramble them up with an algorithm,
- 0:30
making it nearly impossible for a computer to understand its true meaning without the
- 0:33
proper credentials. In today's video, we'll look at 7 useful crypto concepts that every developer
- 0:38
should know. And the best way to learn this stuff is to get hands-on, so we'll implement each concept
- 0:42
in Node.js with its built-in crypto module. And make sure to stay tuned until the end,
- 0:46
because there's a challenge, and the first person to solve it gets a free lifetime pro membership
- 0:51
and t-shirt. Cryptography is the science of creating secrets, and has been around long before
- 0:56
the computer. Before humans got good at math, they would tattoo secrets on the shaved head of a slave,
- 1:00
then let their hair grow out to obfuscate it. But there are some obvious vulnerabilities with this
- 1:04
pattern. An attacker could simply shave the head to access the message. Things got much better by
- 1:08
the time of Julius Caesar, who shifted the letters of the alphabet before passing messages to his
- 1:13
military generals, creating what's known as the Caesar Cipher. Now fast forward to 2025, and all
- 1:18
the algorithms you're using today are made obsolete by super mega quantum computers that
- 1:22
can crack them with brute force. The point I'm making is that cryptography is always evolving.
- 1:27
What is considered safe and secure today may not be the case tomorrow. Luckily, as a developer,
- 1:31
you don't need to understand all the complex math that goes into cryptography, but it is
- 1:35
absolutely essential to understand how certain key concepts work, like hashing, encryption,
- 1:40
and signing, just to name a few. The first concept we'll look at is the hash. What is a hash? The
- 1:45
The name sounds kind of intimidating to me, but the word itself actually has culinary roots
- 1:48
meaning to chop and mix, and that perfectly describes what a hashing function does.
- 1:53
You start with an input, which can be any length, then pass it off to a hashing function.
- 1:57
This function returns a fixed length value of what looks like just meaningless garbage.


