Answer the question
In order to leave comments, you need to log in
How to store encrypted data in a database?
There is a need to encrypt some data that is stored in the database.
At the moment I'm leaning towards the cassandra database stack and RSA 2048 encryption
. For example, there is a table of users id, name, phone. The goal is to encrypt data from the phone column.
And here I have 2 options:
1) enter encrypted data directly in the user table in the phone column
2) select a separate table id, keyId, value (keyId is the encryption key identifier, value is the hash) and store the encrypted data id in the phone column.
Actually why are there 2 options.
Option 1 is simple.
Option 2 will allow you to change the encryption keys by decrypting the value, creating a new string with a hash from the new encryption key, and simply overwriting the string id in the phone field. It will also allow you to move encryption / decryption to a separate service with separate access to the database.
There is still a question with the search for encrypted data, if you have any thoughts - share :)
I will also not refuse criticism about the stack
Answer the question
In order to leave comments, you need to log in
How to store encrypted data in a database?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question