5 ms·
One would hope that the encryption key wouldn't be in the database. The point remains - there is a benefit to reversibly encrypted passwords versus plaintext o
by ceejayoz 15y ago
One would hope that the encryption key wouldn't be in the database.
The point remains - there is a benefit to reversibly encrypted passwords versus plaintext ones. It's certainly not ideal, but it's better than nothing.
- tptacek 15y agoRespectfully, who gives a shit if it's in the database? If you lose the database, you lose the box. You're done. Whatever information you were storing reversably anywhere in your data center, you are going to lose. Don't store reversably encrypted passwords: full stop.
- ceejayoz 15y ago> If you lose the database, you lose the box. Hardly. The SQL injection may have occurred with a limited-access SQL user. The encryption algorithm might be strong enough to give you years or decades of protection against brute forcing. etc. etc. etc. > Don't store reversably encrypted passwords: full stop. Absolutely. I'm just pointing out that "there's no difference between plaintext and reversibly encrypted passwords" is a blatant lie.
- tptacek 15y agoYou already responded to the comment where I said it's possible to rig up a database so that your app server might survive SQLI, so let me just wrap this unproductive little thread up by saying: I don't believe you. If I see you mailing user passwords back to users, I will bet on SQLI losing all those passwords every time, at any odds. Nerds like us are always going to come up with some twister counterfactual scenario where someone somewhere could do something unexpected. I don't care. None of this is relevant to the issue at hand. This company probably isn't even encrypting passwords, but whether they do or they don't: if they get owned up, they're losing all of them.
- drdaeman 15y agoIf your email provider supports CRAM-MD5 or DIGEST-MD5 authentication (on SMTP, POP3 or IMAP) — they're storing your password either in plaintext or reversibly encrypted. If your ISP provides PPPoE, PPTP or IPsec-less L2TP connectivity and support CHAP, MS-CHAPv2 or PEAPv0/EAP-MSCHAPv2 authentication — they're probably storing your password in plaintext. And while the email providers'd better start dropping this practice (as most mobile phones nowadays support SSL/TLS) and use TLS, ISPs are better stay with plaintext passwords. Wiretapping Ethernet, DSL line or open WiFi hotspot is orders of magnitude easier than hacking into the database. Obviously, that's only until the day majority of SOHO routers and other client hardware would support EAP-TLS.
- tptacek 15y agoCRAM-MD5 and DIGEST-MD5 are terrible for exactly this reason; a similar argument is part of the reason nobody uses HTTP digest auth. Mitigating this vulnerability is part of the motivation for SRP, which is computationally hard to brute force and non-reversable.
- drdaeman 15y agoAn active attacker having access to the DB, may use encryption to his heart contents. If encryption's badly implemented (for example, using algorithm prone to chosen-plaintext attacks, or encrypting without salting so same plaintext are always encrypted to same ciphertext) no knowledge of key material is required to gain access to fairly significant number of accounts.
- ceejayoz 15y ago> An active attacker having access to the DB, may use encryption to his heart contents. If the encryption is done by the DB layer, which it often isn't.
- jbri 15y agoAlternative attack: Change everyone's email address to one you control, get the system to send everyone a "you forgot your password" email.
- n09n 15y agoThat requires write access to the database, not just read access.
- ceejayoz 15y agoThat attack isn't unique to a system with reversible encryption. If I can change the e-mail column, I can do this on any system with one-way password hashing too.
- jbri 15y agoNo you can't (or rather, it's not very useful). Sure, you can set someone's password to something you know that way - but since you've already got write access to the database, you might as well do it directly. This is a flaw of any system that sends your password back to you in plain text, that is not shared by systems that don't.