Answer the question
In order to leave comments, you need to log in
How to generate public_key based on user's password?
Good time of the day.
The problem is this.
I need to encrypt a string in a database with one key but decrypt it with another.
Those. when adding a record to the database, the system encrypts the string with the password "password1". When the user needs to decrypt this string, he enters his password "pass2" and it is decrypted.
I was interested in the RSA algorithm, but as I understand it, public and privat keys are completely random there.
Is there a way to solve this problem..? Or perhaps I approached the question from the wrong side?
Thanks in advance for your replies.
UPD1: Thank you very much for your replies. Turns out it wasn't that hard...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question