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: PHP/MySQL Data Encryption

2 pointsby jrsmith1279about 13 years ago
Forgive my ignorance, but I need to store some sensitive data in a MySQL database and this data will need to be retrieved and displayed to the user at a later time. I understand the various methods for encrypting/hashing and then comparing a password against the hash, but what I really need to do for this project is to be able to decrypt the data and display it as plain text.

2 comments

Rustabout 13 years ago
Check out <a href="http://appwithphp.com/cryptography-and-php/" rel="nofollow">http://appwithphp.com/cryptography-and-php/</a> - it's a beginner/intermediate overview of how to implement one-way and two-way hashing/encryption in PHP. The concepts should be transferable to other languages though.
cd34about 13 years ago
<a href="http://us3.php.net/manual/en/book.openssl.php" rel="nofollow">http://us3.php.net/manual/en/book.openssl.php</a><p>you would store a private key on the server, store the blob in mysql and encrypt/decrypt as needed.<p>There are other library wrappers as well.