News for hackers. Stuff that matters.
Re:We didn't encrypt your password, we hashed it by greggman3 on Saturday September 05, 2020 @02:06AM (#24381687)
I'd argue it's bad API design. You can't make an API that's easy to use wrong and insecurely and then be surprised that people use it wrong and insecurely.
Re:We didn't encrypt your password, we hashed it by 0xFluegel on Saturday September 05, 2020 @06:30AM (#24382648)
I can only half agree with you on that. Yes, I also dislike APIs that make wrong or unsafe use easy and correct use more bothersome but seemingly no different in behaviour (until it goes BOOM), but I also find that soooo many people simply don't have the awareness that they are interfacing with another system that interprets their data in a potentially unsafe way. And these people will misuse any API like this.
Re:We didn't encrypt your password, we hashed it by larssorenson on Saturday September 05, 2020 @11:27AM (#24384262)
Unfortunately short of forcing everyone to use an ORM I don't see how we can block the unsafe API, which I'm assuming to be the string-based query interface e.g. `conn.query("SELECT * FROM users")` since any interface that accepts a string will allow a dynamically constructed string which lets developers open themselves to injection attacks. Only ORMs AFAIK can prevent this, e.g. db().users.all() or db().users.select(name="bob").

Maybe there's a clever trick I'm missing here.

Re:We didn't encrypt your password, we hashed it by aaronmdjones on Saturday September 05, 2020 @07:37PM (#24387712)
It'd be nice if the languages offered a way for the query-compiling function to require that the query strings given to it are static, compile-time strings.