How can personal information that needs to be retrieved at a later date be stored securely in a database? For instance when companies store social security numbers and use them for taxation purposes. They have to be stored securely obviously, and retrieved later. It seems using hashes and salt as with password storage isn’t the correct solution. From a high level, how is this done?
Encryption is what you want. Password hashing schemes just check that you've heard the same password twice. They don't even let you figure out what the password is. Encryption would.
Tread lightly here because there are many laws about storing social security numbers. Just saying "It's encrypted" isn't enough. For example, where are you storing the encryption keys? How secure are they?