This is the fifth article in a series on the basics of cryptography:
- Cryptography 101: Hashing
- Cryptography 101: Encryption – One Time Pad
- Cryptography 101: Encryption – Symmetric Keys
- Cryptography 101: Encryption – Asymmetric Keys
- Cryptography 101: Realistic Security
DISCLAIMER: These articles are meant for educational purposes only. The methods explained here are meant only to illustrate the basic concepts of cryptography and may or may not be suitable in real world applications. For serious applications such as financial transactions, I recommend hiring security professionals and also getting a lawyer involved. Use this info and code at your own risk, I claim no responsibility!
If you want more in depth information about cryptography than these introductory articles provide, I highly recommend a book called Applied Cryptography by Bruce Schneier. That book literally almost didnt get published because the NSA didnt want the info getting out into the public. Yay for the 1st amendment!
Realistic Security
“Everyone has a plan ’till they get punched in the mouth.” — Mike Tyson
Cryptography is really awesome, and as a friend of mine said today (BOOOOOORIIIIIIIS your grandma is calling you!) , there’s a certain mathematical purity to it that’s really appealing.
However, in most security systems, cryptography is not the bottleneck. There’s often way easier things to attack and often you just need to defeat the weakest link in the chain to break open the whole thing.
A popular and successful method of attacking secure systems is something called Social Engineering which you see a lot of in movies like “mission impossible” and “sneakers”.
Social engineering is when you chat up the receptionist and get her to give you info she really ought not to give out, or when you call a company claiming to be maintenance and asking for the door code to get in after hours. Often much easier than trying to factor gigantic primes or the like 😛
Beyond social engineering, there is also physical security to watch out for. I attended DEF CON in vegas for a few years with my good buddy LagGod and learned some really interesting things. DEF CON has gotten pretty packed in recent years but i highly recommend going if you are at all interested in security. Lots of really talented people on both sides of the fence (attackers aka black hats, and defenders aka white hats) and even some feds and random technophiles thrown in. Here’s two really memorable security lessons I learned at those conferences that really put security into perspective for me.
Hacking Into a Wifi Network the Easy Way
Note: this no longer works as advertised, thanks to advancements in wifi security technology, but the principles are still interesting and could work in other situations you may find yourself in. Also, it’s good to know weakness of systems past and present to better protect other systems. Otherwise, only the criminals have guns and we are all screwed 😛
Ok so lets say that you want to hack into a company’s network, and lets say that they have a wireless router where when you first try to access it, you are presented with a web browser login screen to type in your username and password.
How wifi networks used to work is that if you were trying to connect to a wifi network, it would pick the router that had the strongest signal that was broadcasting the network id that you wanted to connect to.
What this means is that you as a hacker could drive into the parking lot of a company and broadcast their network id with a really strong signal. Then, when people tried to use their network, the traffic would be directed to your machine.
If you saved the html of their login page before turning on your fake network, you would be able to present a web page to the people hitting your network that looked exactly like the login page they were used to seeing, except that you could take all those usernames and passwords they entered, and log them to a text file!
After you’ve harvested a few logins, you turn off your network and then log into theirs. Thanks for the logins d00ds!
I’m not sure how they solved this problem, but you could probably do something with public key encryption to make sure that everyone who is broadcasting a network id is actually legitimately part of that wireless network.
Defeating Biometrics
Again this is somewhat dated info, but it’s still pretty interesting, and possibly useful for other situations.
It used to be that finger print scanners were a lot simpler (some cheap ones might still be). It used to be that if you mashed a gummy bear onto a finger print scanner, that the scanner would pick up the oily fingerprint of the last person that used it, which surely is a valid user, and so, the door would open, the laptop would unlock, or whatever else.
They fixed that problem by having it detect heat, listen for a heartbeat, and probably lots of other secret or publicized ways, but it used to work pretty regularly!
Something else to say about biometrics is that despite the complexity of the actions they preform, I’ve been told that often times there is just a single wire going into them, and a single wire going out of them. For all those fancy actions, all the thing does in the end is complete a circuit of two wires. If you really need to get in somewhere, you are likely able to smash open the box and connect the wires, circumventing the “infallible” biometrics reader.
Final Notes on Security
Here are some final words on security.
- There is no such thing as perfect security, there is only good enough security. The only way to get perfect security is to lock your computer in a safe and drop it into the Marianas Trench (although I hear you have to watch out for James Cameron these days).
- Good enough security often means just making sure you aren’t the low hanging fruit. If you are more difficult to attack than your peers, you are safer than they are. if you and someone else are running from a lion, you don’t need to outrun the lion, you just need to ourtun the other guy!
- If your security is based on the fact that your algorithm is secret, that is called “Security Through Obscurity” and is really weak security. You should assume your attacker knows the details of everything for better security. Also, secret algorithms don’t get peer reviewed, so weak techniques don’t get weeded out. Don’t forget that people STILL haven’t cracked the 72 bit RC5 message. A single message with a 9 byte key, published in the mid 90s, attacked by distributed computer networks, and still, it hasn’t been cracked despite the algorithm being publicly available. That is some good security right there.
I went to a talk at either DEF CON, or San Diego’s Toorcon (sorry, can’t remember which) where the author Bruce Schneier (who is mentioned in the disclaimer / header of these articles) gave a talk after he had just published a book as a sequel to Applied Cryptography. He said something like “Throw away the other book… physical security is the only thing you really need to be worried about.”
BTW Bruce, if you are reading this, thanks for that first book anyways man, you rock (:
… and let me know if i misquoted you 😛
Thanks for reading! Now go forth and cryptophy. HACK THE PLANET!