Live data from Hacker News

You might not need to store plaintext email addresses

blog.klungo.no

31–40 of 181 posts

Re: You might not need to store plaintext email addresses

#31

Storing email feels like a no-brainer for a system that needs to send messages to its customers. Some prefer phone numbers, which maybe provide stronger guarantees while being maybe not as long lasting. As an individual, the issue is that "anon" or "throw-away" emails are not that commoditized. I heard that "login with Apple" meant to provide an email proxy, hiding your real email, but I have not seen it deployed, ex…

how are wildcards not low maintenance?

Re: You might not need to store plaintext email addresses

#33
post #21

Earlier quoted context omitted.

You could store the hash of the downcased address plus a capitalization mask which tells you which letters to capitalize. This works from a technical perspective, as letters with ambiguous capitalization (Turkish i, etc) aren't allowed in emails. It's a very minor privacy compromise: if a user has a very rare pattern of capitalization then an attacker with access to the database could identify their account. Negligib…

It’s a neat idea but unfortunately RFC 6531 opened up the local part to most of UTF-8, so internationalised capitalisation is in the mix now. Ultimately I’ll never advise delivering to email addresses other than the precise octets of the one already verified, and this means the gold standard is always folding for match and uniqueness, but delivery precisely as verified. How about this: store the verified email addres…

> For extra jollies, only decrypt it on the client.

Uh... How does that work if you need email address to send email to the user? If only the client is able to decrypt the addess, you will basically have to wait until the user connects and gives you the email (which your presumably never store long-term, handling it like you'd handle credit card numbers). That severely limits what you can do with an address.

If you're okay with being technically able to access email address, you'd probably better off with just straight encryption. That solves data leak protections, key rotation, backups, etc.

If you want some magic ID which is known only to the user and your servers will only use it to verify identity, then why not use just passwords with client-provided KDF parameters. Your machines will never know the plain data.

Re: You might not need to store plaintext email addresses

#34
That might be in breach of the GDPR. In the event of a personal data breach, you need to tell the data subjects about the breach [0]. You can’t just put a notice on your page, since someone might not be using your service any more, but you still have their data. And GDPR aside, it is very short-sighted to assume you will never ever need to e-mail users on your own.

[0]: https://gdpr-info.eu/art-34-gdpr/

Re: You might not need to store plaintext email addresses

#35
post #13

It's a good idea to protect user privacy. One drawback I can think of storing a hashed email is - What if the user forgets the username / email id and wants to know it? (This is a common use case). In such a case you have to collect additional unique data to help the user gain access to their account, but that defeats the original purpose - to protect user privacy.

People often forget usernames but not so often e-mails. The e-mail is usually the primary/only means of identifying users anyway so you're not going to provide it back on request anyway.

They won't forget the email, but they might easily forget with which email they registered (happened to me).

Re: You might not need to store plaintext email addresses

#38
post #36

Maybe this is a dumb question but how do you send an email if you only have the hash of the recipient's address?

As per the article, you only send them when the user requests an action, and ask them for their email at that time

Oh. I would be pretty annoyed if I had to re-enter my email address every time I perform an action that sends out a transactional email...

Re: You might not need to store plaintext email addresses

#40

You use email+password for login. Does this mean that on every login attempt, you iterate through every row in the database to check for a hash match?

I mean, how's that different from 'iterating' over every row in search of an email address? Indexes solve that.
Post reply on HN