3 ms·
Look, I don't care if you use PHP. But if you aren't an expert, and your code hasn't been audited by experts, don't write your own crypto. Use libsodium, or lib
by qwertyuiop924 10y ago
Look, I don't care if you use PHP. But if you aren't an expert, and your code hasn't been audited by experts, don't write your own crypto. Use libsodium, or libressl's libcrypto (if you think openssl is a good bet, you really need to see the talk that discusses the reasons for that fork), or libgcrypt. But for crying out loud, use a library that is actively used and vetted by people who KNOW WHAT THEY'RE TALKING ABOUT. And do your best to know what you're talking about, too.
- tptacek 10y agoNo! Libre/Open/BoringSSL's libcrypto exposes the same low-level primitives as PHP's terrible crypto bindings do. Please, please don't build things directly with libcrypto.
- qwertyuiop924 10y agoAh. Ouch. Sorry.
- sangnoir 10y agoAnd that - in an ironic nutshell - is the problem with crypto: had you been tasked with implementing the crypto, you would have (unknowingly) done it wrong and called it a day. Someone else would be berating you to "leave it to the experts"
- qwertyuiop924 10y agoI was going to write a comment pointing that out. But I couldn't figure out how to write it. Go ahead, laugh. It means you'll be hesitant to make that kind of mistake, which is the main thing.
- sangnoir 10y agoI did laugh - but not at you. As I said - the problem is with crypto (not you). Crypto gives the appearance of being simple, straightforward and immutable - but its not. A lot of things can go wrong with your PRNG, or the key exchange, or the cipher, or a combination of any/all of the above. Oh, by the way a novel attack was discovered last week; it's the full package, complete with a mildly ominous ALLCAPS name, a fancy logo and a bloody domain - the state-of-the-art has changed. Again. I don't know if the 'crypto problem' can be solved for all F/OSS projects that need it - there might not be enough experts to go around.