How does encryption keep secrets safe?

Every day, billions of secret messages zoom through the internet — your texts, your passwords, the number on your credit card. Anyone could peek at them as they fly past. So why don't hackers just read everything? Because of a mathematical magic trick called encryption that scrambles messages so thoroughly that only the right person can unscramble them.
Imagine you want to send your friend a secret note, but you have to pass it through a crowded room full of nosy people. You could write it in a code — swap every letter for a different one. A becomes Z, B becomes Y, C becomes X. "HELLO" turns into "SVOOL." Anyone who grabs the note just sees gibberish.
