B
B
BonBon Slick2017-05-03 17:30:08
PHP
BonBon Slick, 2017-05-03 17:30:08

Encrypting a field in a database?

So I encrypted the key using Laravel methods and saved it, then at the entrance I check on the "cast" whether it matches the one in the database. But, the next need arose.
The user has a key, I want to encrypt it in the database (for storage), in case someone hacks the database.
However, the user, the owner of the key, can view or change it.
An example, a product: its key is encrypted in the database, however, after the purchase, I send the key to the user, he can see it.
How to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sisyukin, 2017-05-03
@Caarl

You confused what is encryption and what is encoding.
The string that is written in password in Laravel, the framework encrypts it in the bcript algorithm, it is almost impossible to decode such a hash.
Create a column where you will write encoded passwords according to the algorithm that you choose or come up with yourself.
But I’ll tell you the idea right away ... You can’t store passwords like that ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question