Settings

Theme

Ask HN: PHP/MySQL Data Encryption

2 points by jrsmith1279 14 years ago · 2 comments · 1 min read


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.

Rust 14 years ago

Check out http://appwithphp.com/cryptography-and-php/ - 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.

cd34 14 years ago

http://us3.php.net/manual/en/book.openssl.php

you would store a private key on the server, store the blob in mysql and encrypt/decrypt as needed.

There are other library wrappers as well.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection