Level 3 · 3B Encryption · Lesson 1 of 3
Encrypting is not the same as hiding
Encrypting means turning a readable message (the plaintext) into something unreadable (the ciphertext) that only someone with the key can turn back. The recipe, the algorithm, is public; the only secret is the key. That's why good encryption can be studied all over the world and still stay secure.
Three things people mix up
Encrypting needs a key to go back. Encoding (like Base64) only changes how the data is written: anyone undoes it without a key. Hashing produces a one-way fingerprint: you can't get back to the original. Many systems fall because someone “encrypted” a password in Base64 and thought it was protected.
echo hola | base64
echo aG9sYQ== | base64 -d- The first line encodes “hola” in Base64: it becomes aG9sYQ==.
- The second undoes it with -d, without any key. That's why Base64 protects nothing.
Symmetric encryption
In symmetric encryption the same key encrypts and decrypts. It's extremely fast and it protects your disk, your backups and almost everything that travels across the internet. Today's standard is called AES. Its weak spot isn't the algorithm but the key: if it's short, guessable, or you send it the same way as the message, everything falls apart.
Going deeper
The Caesar cipher and why it no longer works
Julius Caesar shifted each letter three places (A became D). It's a toy symmetric cipher: there are only 25 possible keys and you can try them all in seconds. Modern ciphers have so many possible keys (with AES-256, a 78-digit number) that trying them all isn't possible even with every computer in the world.
Review questions
What really protects an encrypted message?
Answer: The key. Good algorithms are public. Security depends on the key being secret and hard to guess.
A configuration has clave_bd: U3VwZXJQYW1wYTIwMjY=. Is it protected?
Answer: No: it's Base64 and anyone can decode it. Base64 is an encoding without a key: with base64 -d the original text appears.
In symmetric encryption...
Answer: the same key encrypts and decrypts. Symmetric means there's a single shared key, as in AES.