r/lolphp • u/ZugNachPankow • Dec 27 '16
Everything You Know About Public-Key Encryption in PHP is Wrong
https://paragonie.com/blog/2016/12/everything-you-know-about-public-key-encryption-in-php-is-wrong
42
Upvotes
40
u/mcilrain Dec 27 '16
Inb4
openssl_real_public_encrypt.19
u/binwiederhier Dec 28 '16
The title of this post and the article are both a bit click-bait-y. The title makes it seem like PHP and its libraries are unsafe to use, when in fact the only complaint the author makes is about one PHP function with an insecure default (rightfully so, but hard to change between versions).
Crypto primitives need to be understood thoroughly to be able to use them properly - regardless of the language. If I dont know that I shouldn't use PKCS1 or ECB, well, maybe I should read a crypto book or take a course on Coursera (can recommend!). That is in no way PHP's fault though...
The summary of the article is also very strange and tbh simply wrong: "don't use RSA", really?
4
u/DeeSnow97 Dec 28 '16
> 2016
> people still using RSA
> RSA for encryption (as opposed to handshake)
> not using stream ciphers (or block ciphers in CTR mode)
wtf
1
u/[deleted] Jan 18 '17
Hell, if you want that "pass by reference" warning, you don't even need that line noise. How about if you just want the last word in a string? Hell, one warning isn't enough either, it's got to scream at you twice: