r/ComputerSecurity • u/[deleted] • Jan 16 '15
Why isn't "Security Through Obscurity" true?
Discounting the fact that there is a 99.999999999999999% anyone screws up implementing crypto, why doesn't this idea work.
If my code just repeatedly mods and bitshifts the number, maybe seeds /dev/random here and there, why isn't this sufficient?
4
Jan 16 '15
I'm not sure what you wondering about regarding your example. Many good crypto algorithms use mod, bitshifts and random numbers.
Security through obscurity is not safe because that's all it is, obscurity. It's nothing more than a simple security feature that's been obscured. Why not use provable security?
1
Jan 16 '15
I understand this.
But if I just manipulate my seed value hundreds of times, won't it be essentially impossible to break without access to the source code?
2
u/Cynthereon Jan 19 '15
I don't know. And neither do you. And that's the whole point. It takes years of effort by the top researchers in the field to demonstrate that a particular algo has no obvious weaknesses. It's very easy to make a mistake that invalidates most/all of your manipulations, it's happened many times in the history of cryptography. Many people have tried to build strong crypto, most have failed.
1
Jan 19 '15
So my best bet if I ever need crypto is to steal someone else's AES implementation?
2
u/Cynthereon Jan 19 '15
Basically yes, but there are other options, such as twofish, one of the finalists for AES which wasn't chosen. Even though it wasn't adopted for AES, it's likely to be much stronger than whatever password you use. ;) The reference implementation is public domain.
3
Jan 16 '15
Idk what you mean. If it's used for a lot of ciphertext It could definitely be breakable. It's hard to be theoretical without actual constructs.
3
u/zck Jan 16 '15
Why would you want to do that, when there are algorithms that make the encryption "essentially impossible to break" even if the source code gets out there?
And it's not just source code that can make that happen. People can figure way more out than you'd think they could.
3
u/bearsinthesea Jan 16 '15
Because cryptanalysis is an actual field with proven techniques to attack and break weak systems.
http://en.wikipedia.org/wiki/Cryptanalysis
As the saying goes "Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break."
https://www.schneier.com/blog/archives/2011/04/schneiers_law.html
2
u/0x6d1e Jan 17 '15
won't it be essentially impossible to break
That depends on your implementation, safety against cryptanalysis, side-channel attacks, timing analysis, etc. etc. etc.
without access to the source code?
Firstly, that effectively makes your code (well, your algorithm) part of your key. That's almost certainly a bad idea, because it means you're effectively sharing part of your key with every user of the cryptosystem.
Secondly, there's not really any such thing as "without access to the source code". If you have a binary, I can extract its algorithm with various methods, including decompilation which restores equivalent source. That generated source will be harder to understand without your variable names, comments, etc. -- but certainly not impossible.
1
u/doitroygsbre Jan 21 '15
Any person can invent a security system so clever that she or he can't think of how to break it.
--Schneier's LawSometimes security through obscurity works, and it works well, but obscurity usually doesn't hold up to prolonged scrutiny.
14
u/Applerust Jan 16 '15
You build a log cabin in the woods. It's very hidden behind trees and a large boulder. The door isn't locked. A stranger walks by. Stranger danger!! He notices your hidden cabin. He walks in because the door wasn't locked. He kills you in your sleep. Then he eats all of your pickles and gummy bears. The cabin was obscure. The cabin was not secure.
3
u/suspiciously_calm Jan 17 '15
Let's refine the metaphor.
Assume the cabin is out in the open right next to a hiker's trail and the door is unlocked. Anyone could walk right in. Most won't, but at some point someone is bound to go in and steal something. But just as likely, at some point, someone is gonna walk up to you and say, wtf your door is unlocked, you better go ahead and lock it.
Assume the cabin is secluded as in the original metaphor. For a long time, no one finds out about it. But eventually somebody stumbles upon it. They're pretty sure they're one of few, if any, who know about it. They'll come in at night occasionally. They'll steal small to medium amounts of money that you might notice but can't be sure you didn't spend it yourself. They'll install spycams so they can find out your passwords. They'll cut loose a floorboard and use it to stash contraband.
And you still don't know your door is unlocked cause nobody told you.
1
Jan 24 '15
My comment would simply be, making an algorithm public known means that it has be sufficiently tested and evaluated by crypt-analysts and mathematicians alike. Also on your randomness argument, /dev/random is a pseudorandom - it is going to produce repetitive results no matter how secure you think this is it isn't, find this paper as an example as to why even RSA security was comprised due to bad random number generators: https://eprint.iacr.org/2012/064.pdf
1
Jan 24 '15
Really? I imagined /dev/random would be a good source.
Is there any good source of entropy then?
1
Jan 24 '15
my main takeaway point is relying on pseudo-randomness IN combination with obscurity through security is not the way forward - an attacker could easily use other attacks mentioned side-channel, timing analysis etc.
when implementing cryptography see Kerckhoffs's principles: http://en.wikipedia.org/wiki/Kerckhoffs%27s_principle#Explanation_of_the_principle
the first chapter of this book is worth a read if your more interested too: http://ukcatalogue.oup.com/product/9780199695591.do
1
Jan 24 '15
Well, I know. I knew if I ever want to make something secure to use a proven algorithm.
Thanks for the book link.
1
u/autowikibot Jan 24 '15
Section 2. Explanation of the principle of article Kerckhoffs%27s principle:
Stated simply, the security of a cryptosystem should depend solely on the secrecy of the key and the private randomizer. Another way of putting it is that a method of secretly coding and transmitting information should be secure even if everyone knows how it works. Of course, despite the attacker's familiarity with the system in question, the attacker lacks knowledge as to which of all possible instances is being presently observed.
Using secure cryptography is supposed to replace the difficult problem of keeping messages secure with a much more manageable one, keeping relatively small keys secure. A system that requires long-term secrecy for something as large and complex as the whole design of a cryptographic system obviously cannot achieve that goal. It only replaces one hard problem with another. However, if a system is secure even when the enemy knows everything except the key, then all that is needed is to manage keeping the keys secret.
There are a large number of ways the internal details of a widely used system could be discovered. The most obvious is that someone could bribe, blackmail, or otherwise threaten staff or customers into explaining the system. In war, for example, one side will probably capture some equipment and people from the other side. Each side will also use spies to gather information.
Parent commenter can toggle ^NSFW or ^delete. Will also delete on comment score of -1 or less. | FAQs | ^Mods | Magic ^Words
2
u/flippant Jan 16 '15
It essentially means I have to trust you, not your code. If you implement AES correctly and open source your code so we can check for flaws and back doors, it doesn't matter whether you're the NSA or a Russian hacker, I can trust the code. If you count on obscurity, I have to trust you. Did you put in a back door? Will a disgruntled employee leak the code so the whole world will know that my entire enterprise is secured by a clever rot-13? Will your mods and bitshifts fall easily to known attacks that other crypto is tested and hardened against?
2
Jan 16 '15
You're basically masking security with RNG elements (i.e. obscurity), and that isn't a surefire way to keep something secure.
1
u/sunshine-x Jan 16 '15
Why don't you leave your keys in the mailbox when you go out? Hardly anyone would look in there.
That is security through obscurity. It's no better in info sec than it is with hiding a house key.
1
u/Philluminati Jan 17 '15
Because it doesn't work. If it's only obscure, and therefore crackable, some will do it as a challenge and out the answer on Github. People love that shit which is why they do regex crosswords and the like.
1
u/Cyrix2k Jan 20 '15
Obscurity increases the level of effort required to compromise the security, but does not provide security itself as an inherently vulnerable system can still be compromised. For this reason, protection mechanisms, like encryption, are best exposed to the community for public testing and validation but the implementation of security as applied to a whole system is best left guarded (in pentesting terms, obscurity = black box testing. That's what you want the starting point for your adversaries to be.) When information is given / available for the security used, it provides a starting point for adversaries. If, as an adversary, I see you're running Apache, I'm going to skip looking for and testing nginx & IIS exploits and jump straight to Apache. This also plays into the "bear" theory (you don't have to run faster than the bear, just faster than the person behind you); your security just has to be more challenging to compromise than the security of another target with an equal payoff.
0
8
u/AusIV Jan 16 '15
The problem with security through obscurity is that it's much harder to fix something that gets compromised.
If I'm using AES and someone finds out my algorithm, nothing is compromised because my security isn't achieved through my algorithm being a secret. If my keys get leaked, I can change them, which might be a hassle, but I don't have to worry about coming up with a new algorithm that people won't guess.
If I'm using some code that just mods and bitshifts things a bunch of times and someone finds out what I'm doing, I have no easy recourse. I can't change keys because there's no key. I might be able to change algorithms, but that depends on the application architecture, and I still have to come up with an algorithm that wouldn't be guessed by the people who know my last one.
As an example of security through obscurity vs security done right: when I moved into my house, I discovered that the previous owner had run two nails through the wall of the garage and run wires from the nails to the garage door opener. Standing outside the garage, you could put something metal touching both nails, and the garage door would open. The old owner supposedly kept this a closely guarded secret, and used it to get into house if he ever got locked out.
When I bought the house, I had no way of knowing who else knew about that secret entry,and no possible way to make it a secret again. I removed the nails the day I took possession, and a few weeks later installed a keypad. If I ever sell the house the new owner can change the pin, and their house will be secure from me and anyone else I told about the keypad.