Real Encryption: A Mathematical Case Study
We had a discussion in my Ethics class about encryption, and it really amused me to hear how many people think that maximum strength encryption doesn't matter and that our government has the technology to break (in a reasonable amount of time) any encryption scheme. I started thinking more about it, and I thought that I would do a little mathematical case study regarding basic cryptographic concepts, and show what "real encryption" means and the power people actually have.
First, something that everyone reading this must realize before I continue. I can write a Java code snippet in about a half-hour that can encrypt a text file that no government on this planet could decrypt in less than a hundred years. The idea that "big brother" is always around us, and has futuristic technology able to break all encryption schemes is completely false, and here is the proof.
Background Information
When your bank says that its online software uses 128-bit encryption, that means that it uses a 128 bit long password (or "key") to encode your information during transfer. 128 bits equals 16 characters (16 bytes, ASCII encoding), therefore 128-bit encryption uses a 16 character randomly-generated password. Each character in this password can use all 128 different ASCII characters, which includes all numbers, punctuation, spaces, and letters in the English alphabet (plus some additional characters). 1024-bit encryption is based on a 128 character long password (1024/8 = 128), and so on. Because we are using ASCII encoding, every single slot in the 128 character long password can have 128 different possibilities, so a password that is n characters long has 128 ^ n different combinations possible.
Hypothetical Situation
Imagine a 1,000,000 node cluster of 2.0 Ghz PCs, all clumped together for the sole purpose of brute-force hacking encrypted files. Now say the CIA is using the full computing power of this million-node cluster to go through every single permutation of your password in order to break your encryption scheme. This hypothetical situation will be used for the rest of this case study, so remember those numbers.
A 2 Ghz processor can perform 2 million operations per second (if you assume one operation per clock cycle, we are approximating this because I don't want to confuse anyone). We will assume that the CIA is using special software that can check through one full permutation to see if it works during every clock cycle (this is a huge if), so this means that every second, every node, is moving through 2,000,000 possible combinations and trying to match it against the cypher text. We have one million nodes, so every second, 2,000,000,000,000 (2 trillion permutations, or 2 x 10^12) are being tested to see if they work.
2,000,000,000,000 * 60 seconds * 60 minutes * 24 hours * 365 days = 6.3 x 10^19 possible permutation tries every year. That seems like a hell of a lot of different combinations of letters, but if you do the math, regular 128-bit encryption with a 16 character password has 128^16 different combinations. This equates out to 5.19 x 10^33 to be exact, which would take almost two years of brute-force hacking to crack.
Beyond 128-bit Encryption
In the first paragraph, I said that I could write an algorithm to do this, and I can. By using symmetric XOR encryption, one of the simplest encryption techniques, and a randomly-generated password of sufficient length (we'll work with 1024-bit encryption for this — 128 bytes, or 128 characters), we can use a little math to see just how long it will take to decrypt this home-made encryption.
By using Google, we can see that there are 5.28 x 10^269 different combinations with a 128 character password. By dividing that number by the million node number we found before, we see that it will take roughly 8 x 10^249 years before we can crack that encryption using the world's largest clustered computing structure, very fast computers, and with 100% uptime.
So here is the power you have: a 10-line code snippet you write can encrypt a data file so tightly, that it would take more years to decrypt it — with current technology — than have passed since the inception of the universe at the Big Bang. Now when you have something that you really need to be private, think of this post, and then get yo crypto on.
Roberto weighs 27lbs, is nearly 4ft long, and is headed for your house right now to dominate you and your family.
The test if over with and I probably got some sort of an A on it. All thanks to this post! Yeah!!!!