6 ms·
Public-Key Encryption in PHP
- victoryhb 10y agoEverything you know about my knowledge about Public-key Encryption in PHP is wrong
- CiPHPerCoder 10y agoI know nothing about individual readers' knowledge. However, when addressing the general audience (programmers and in particular PHP developers), I've seen enough projects (both open source and proprietary) that attempted to provide public key encryption to have an idea of the average developer's competence here. For example, this library for integrating with a payment gateway: https://github.com/pagarme/pagarme-php/issues/29 https://github.com/pagarme/pagarme-php/issues/29 There are people who can do public key encryption in PHP safely†, but when left to their own devices most people will not. Thus, the headline. † I would go as far as to claim the global population of full-time PHP developers who can securely implement public key encryption in PHP without outsourcing to libsodium is less than 10.
- ohyeshedid 10y agoDo all 10 work at your company, or are the remaining 9 employed elsewhere? You get called out for using clickbait headlines, and then double down by stating an absurd and baseless opinion. Not a good look, man. Decide what you want; to share insights and information or gain attention.
- CiPHPerCoder 10y ago> Do all 10 work at your company, or are the remaining 9 employed elsewhere? I'm only aware of one other person who fits the criteria I've stated (many others would if I loosened the "work with PHP full time" restriction). > You get called out for using clickbait headlines, and then double down by stating an absurd and baseless opinion. Absurd and baseless? There are probably very few security researchers that have looked at more application-layer cryptography features than I have, especially those written in PHP. If you know of any: Ask them if they believe my assessment of the PHP community is wrong. https://paragonie.com/security/advisories https://paragonie.com/security/advisories https://github.com/issues?utf8=%E2%9C%93&q=author%3Aparagonie-scott+cryptography+OR+crypto+OR+AES+OR+RSA https://github.com/issues?utf8=%E2%9C%93&q=author%3Aparagoni... You're free to dislike the headline. I've got nothing to say in defense of it.
- dang 10y ago> You're free to dislike the headline. I've got nothing to say in defense of it Please don't use such headlines on HN. As this thread demonstrates, they derange discussion.
- CiPHPerCoder 10y agoOK, I thought the "use the original headline" rule was stricter but just reread the guidelines and saw that I was wrong.
- tptacek 10y agoWell, you wrote the headline, so I think the real recommendation here is to avoid cutesy headlines.
- mSparks 10y agoplease take your life somewhere else.
- ohyeshedid 10y agoNobody is assaulting your ego; you're doing that to yourself. I'm not doubting your experience or knowledge, and I appreciate that you're driven to share it. I can see that you genuinely care, and that your intent is most likely virtuous. I am, however, suspicious of your approach to and style of communication; as are others. Generating attention is the not the same as interest, man. It's baseless because you can't quantify how many full time PHP devs there are in the world outside of your own acquaintance. That's not enough information to lend your statements any validity. You can stand on your own merits without trashing everybody you don't know.
- CiPHPerCoder 10y ago> You can stand on your own merits without trashing everybody you don't know. I think I see the problem here. You're parsing my statements as a sort of attack on others. Let's try this: The global population of full-time PHP developers who are qualified to perform brain surgery is probably less than 10. Is that statement less controversial? Understanding cryptography isn't exactly a requirement for being a successful PHP developer. Additionally, the folks who do know cryptography very rarely find themselves working on PHP full-time: There's too much industry demand in other areas. That most developers who work on PHP full-time do not have this particular skillset is NOT an attack on most developers. It's simply an observation and a reasonable consequence of the absence of market pressures. Also, it's a difficult subject.
- reitanqild 10y agoFeel free to find out who CiPHPerCoder is before you throw insults ;-)
- tptacek 10y agoThis is an extremely unproductive comment that has nothing to do with the article.
- didgeoridoo 10y agoDupe from two weeks ago (plus a few other times that this user submitted it). Conversation here: https://news.ycombinator.com/item?id=13171409 https://news.ycombinator.com/item?id=13171409
- reitanqild 10y agoNever seen it before and I am reasonably acttive here.
- CiPHPerCoder 10y agoIt floated near the top of page two for a while then died off. I don't know that it ever landed on the front page for any appreciable length of time.
- tptacek 10y agoThere are really only two points being made on that (very short) thread: 1. That PHP is not as a language handicapped for encryption (but the article doesn't claim that it is). 2. That doing public key encryption in PHP sound like a bad idea. I happen to agree with point (2), but the other thread doesn't resolve that argument, so we're not missing much.
- imagist 10y agoTitle is inherently wrong. If a belief I hold is wrong, then I don't know it, I merely believe it. Before you accuse me of being pedantic here: this isn't just semantics. Ostensibly the author means that I the things I believe I know are wrong, but this is just a cheap clickbait technique. The author can't possibly know what I believe to tell me it's wrong. Maybe the author wants to say that a commonly-held belief is wrong. Maybe the author just wants to share some facts. Either way, I'll never know, because the author decided to make blatantly incorrect and somewhat condescending statements in the title. There's no way I'm going to reward that bad writing and bad behavior by clicking the link.
- pavel_lishin 10y ago> If a belief I hold is wrong, then I don't know it, I merely believe it. This is true whether the belief you hold is right or wrong.
- deleted 10y ago[deleted]
- tptacek 10y agoThis is extremely unproductive and has nothing whatsoever to do with the article.
- imagist 10y agoWouldn't it be more productive if they titled their article with something that describes the content of the article?
- cutler 10y ago'Looks like a competent PHP dev could make a decent living as a crypto/SSL consultant.
- spacewhale 10y agoThis dude isn't even a "Competent Php dev". Once this guy posted a new cms, and within minutes people in /r/php were spotting security vulnerabilities..and this dude was like "Duh..didn't drink enough coffee!"...
- bhldr 10y agoLooks like blog spam. Third time this user submits the same link and he/she only posts from one domain.
- CiPHPerCoder 10y agohttps://news.ycombinator.com/newsfaq.html https://news.ycombinator.com/newsfaq.html - See: "Are reposts ok?" Also, your claim that I only post from one domain is demonstrably false: https://news.ycombinator.com/submitted?id=CiPHPerCoder https://news.ycombinator.com/submitted?id=CiPHPerCoder Happy to discuss better strategies for raising security awareness among PHP developers if sharing content on HN is viewed as annoying.
- ckdarby 10y agoHere you go, https://www.reddit.com/r/PHP/ https://www.reddit.com/r/PHP/
- tptacek 10y agoYou have -5 karma. The person you're accusing of being a spammer has hundreds of comments here. Moreover, authors are allowed to post their own articles. Please don't crud threads on HN up with pointless personal attacks.
- tzs 10y agoI'm not sure that cryptographic library functions should have default parameters, at least for parameters that affect security. The argument (no pun intended) for default parameters would be to provide a reasonable value for library users who do not have the expertise to select the parameter value themselves. The problem with this is that if someday the expert opinion on what the default value should be changes, then the library is in an unfortunate position. If they update the library to match the newer expert opinion, it breaks existing code. If they do not update the library, then new applications using it will get the bad default value. Maybe they can leave the default alone, but make the library generate a warning that the default is no longer good and the application should be updated to explicitly pick a better value. If the library had not supplied a default value, then all users of the library would have to make a choice. The library documentation could suggest what choice is considered best at the time, but make the programmer actually say it in the code. That way, if expert opinion changes, the recommendation can change and at least new users of the library might use the better value.
- CiPHPerCoder 10y ago> If they update the library to match the newer expert opinion, it breaks existing code. If they do not update the library, then new applications using it will get the bad default value. This is true for lower-level cryptography libraries like OpenSSL or Libsodium. This isn't true, however, for the sort of higher-level libraries I recommend developers use. See https://github.com/defuse/php-encryption https://github.com/defuse/php-encryption which implements version tagging in its ciphertext output. If Taylor Hornby has to publish a version 3 that uses, say, NORX instead of AES-256-CTR+HMAC-SHA256, the first 4 bytes will identify the version of the library that was used to encrypt the original message. Backwards compatibility is transparent to the end user. (Headers are covered by the HMAC.)
- tptacek 10y agoThere are at two problems with this design principle. The first is that some crypto primitives, whether you want them to or not, have implicit defaults. For instance, when enciphering data with a block cipher, ECB is an implied default. More importantly, even if you require options, the characteristics of the different choices can push developers towards insecure implied defaults. Even in a library that forces you to pick a block cipher mode, for instance, developers have a strong tendency to pick ECB because it doesn't require an IV (and very few developers understand the concept of an IV). I generally think RSA libraries should default to OAEP.
- spacewhale 10y agoAuthor is a well known spammer from /r/php and is probably someone who suffers from delusions of grandeur, and hence is a self declared authority in /r/php. Also is was a failed Hacker in the past who is now on a 'crusade' to cleanse php of any security vulnerabilities.. Currently works as a spammer for the domain in the link, and seems to have a monthly quota of spammy articles to meet from his boss...