3 ms·
You can certainly find libraries with interfaces like that. For example, OpenSSL has extensive libraries for all sorts of cryptographic primitives and protocols
by jgrahamc 13y ago
You can certainly find libraries with interfaces like that. For example, OpenSSL has extensive libraries for all sorts of cryptographic primitives and protocols.
If you take a narrow focus on a particular cryptographic event (such as your encryption of a string with an RSA public key) then you miss the greater story about encryption: it's not just the individual cryptographic primitive that needs to be implemented correctly, it's everything else.
An RSA encryption like that does not stand alone. Keys must be generated, secured and distributed. The RSA library itself must be validated to ensure that it works correctly. The actual primitive must be used correctly (in the case of RSA don't use a stupid exponent as some have done). And the environment within which the encryption is used must be understood and secured (just look at the CRIME and BREACH attacks against TLS to see how something 'secure' can be broken because of something apparently irrelevant, in this case, compression).
The overriding reason that encryption is 'hard' is that secure computer systems have enemies and those enemies (attackers) will do _anything_ to attack the system. They will attack it based on timing, compression problems, flaws in the protocol, freezing the RAM to extract a private key, etc. etc. There's really no end to the variety of things you can try to attack a cryptosystem.
So, building a secure system may have encryption as a necessary condition, but it's not sufficient. So much else can and will go horribly wrong.
If you are interested in this hit the books and understand the history of cryptography. For example, look at how Vigenere was broken by Babbage, or the Venona ciphers, or Lorenz. These 'old' ciphers can tell you a lot about how people actually attack things. Then read about modern ciphers and attacks on them. Wikipedia has much. Read about TEMPEST and imagine other attacks possible in that way.
- venomsnake 13y agoAnd lets not forget the entropy problems - if you control the RNG you control the encryption - case in point http://www.schneier.com/blog/archives/2008/05/random_number_b.html http://www.schneier.com/blog/archives/2008/05/random_number_... the infamous debian openssl error. So you need to be sure in your RNG.
- dspillett 13y agoHaving a good RNG free from external interference is getting easier. Where you previously needed to buy expensive hardware or rely on external services like random.org, many "system on a chip" solutions have built-in hardware RNG (though not all systems build using them expose it in a useful manner) and the newest server lines of chips out of Intel do too. The SoC used by the rPi for instance has such a generator, exposes as /dev/hwrng once the appropriate module is loaded. It passes all the tests I've exposed it to and seems to reliably serve ~550,000 bits/sec. No doubt many other small computers have a similar facility available by some means. That would not have helped that infamous Debian bug of course, as that was due to a change meaning the SSL libs were not properly using the entropy pools that were available (no entropy source is useful if you ignore it).
- rainsford 13y agoI think you hit the nail right on the head. "Encryption" at a low level, like using AES to encrypt a block of data, is pretty easy. But you need a lot more than that to build an encryption system like a secure communications channel. Each individual part is relatively easy to get right, but putting them all together offers a lot of opportunity for attackers to find a way to exploit the system.
- retube 13y agoGreat reply, thanks
- mpyne 13y agoIndeed. All of the crypto providers seem to be running into problems faced by the Allied militaries and security services as far back as WWII. Even when Japanese Naval codes were unbroken, the U.S. Navy was able to provide Adm. Nimitz with valuable intelligence on Japanese fleet movements and concentrations by using nothing more than traffic analysis. Now imagine that computers can automate traffic analysis and what that can bring, encryption or no...
- forgottenpaswrd 13y ago"They will attack it based on timing, compression problems, flaws in the protocol, freezing the RAM to extract a private key, etc. etc. There's really no end to the variety of things you can try to attack a cryptosystem." I will say that in my experience 95% of the attacks are going to be social engineering, less about sophisticated things when the social is way easier.
- 16s 13y agoThreats, imprisonment and physical violence can be used to attack crypto as well. Go after the weakest link.
- ux-app 13y agorelevant xkcd: http://xkcd.com/538/ http://xkcd.com/538/
- podperson 13y agoThe problem is that while probably FEWER than 5% of attacks are technical, they generate industrial scale issues -- e.g. tens of thousands of stolen identities. Even so, while there have been high profile examples of encryption algorithms being shown to be flawed (e.g. RSA had to reissue all its dongles a couple years back because they were using a flawed RNG) I do not know of any actual successful dark-hat attacks along those lines (of course they may have occurred undetected or not been disclosed or I may simply be ill-informed). High profile security breaches are generally a result of poor or no cryptographic practices, negligence (e.g. IEEE keeping its member records in a plain text file on an FTP server), or (as you say) social engineering. In short, while really good cryptography may be hard, halfway decent is not hard, so it becomes a case of "assumed hard and left untried" rather than "tried and found hard". Finally: there's also the problem of security theater, such as forcing people to change their passwords at a ridiculous rate.