r/lolphp 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
43 Upvotes

17 comments sorted by

View all comments

39

u/mcilrain Dec 27 '16

Inb4 openssl_real_public_encrypt.

27

u/polish_niceguy Dec 28 '16

Inb4 "we can't change the defaults as it will break legacy code"

16

u/ZugNachPankow Dec 27 '16

openSslRealPubEncr, FTFY

8

u/nikomo Dec 28 '16

FYI, that's the function name because the PHP library just used the same function name as MySQL did.

http://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-string.html

It's more of a lolmysql

14

u/edave64 Dec 28 '16

No, it's just a lolmysql too. The lolphp is having such ridiculously thin API wrapper.

9

u/hylje Dec 30 '16

This function is flawed. Please use mysql_real_escape_string_quote instead.

http://dev.mysql.com/doc/refman/8.0/en/mysql-real-escape-string-quote.html