TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What are best practices for encrypting sensitive user data on a server?

6 pointsby teapot01about 10 years ago

3 comments

bigiainabout 10 years ago
The timeworn advice is: &quot;TLS for data on the fly, GPG for data at rest&quot;. With suitably updated TLS&#x2F;SSL libraries and configurations, and good GPG keys, this is still sound advice.<p>The big question in my mind is always &quot;Does the server need to be able to decrypt that data?&quot; If the server has the decryption keys, the attacker can probably steal them along with the encrypted data. I store GPG encrypted data on servers where they only have the public key - retrieving the data involves grabbing the encrypted data from the server and decrypting it somewhere else that has the private key available. (This is a handy trick for web forms that collect sensitive data - serialise it and GPG encrypt it immediately, then you can happily send the encrypted blob via non-100%-reliable email,and have the local encrypted blob available if the email copy fails to arrive.)
dutchbritabout 10 years ago
Define sensitive user data and how do you want to store it? In a file or in a database? AES-256 is pretty good for encryption but you also need to handle decryption somehow - and you don&#x27;t really want to store passphrases on a server. Passphrases can be encrypted using pgp if you want multiple users to have access to the passphrase. When it comes to password hashing (not encryption), then go with bcrypt or scrypt.<p>But please define sensitive data more in detail. Are we talking about passwords, messages or photos of passports etc?
评论 #9575084 未加载
teapot01about 10 years ago
What I&#x27;m interested in is how should I encrypt and store sensitive user data on a server such that it is retrievable but secure.
评论 #9575108 未加载
评论 #9574837 未加载