jeudi 7 octobre 2021

How do store/query sensitive text in the database with salt password?

I'm on Laravel 5.8, I need to store/query tokens in the table in the database.

Ex. My token is

eyJhbGciOiJS1234zz

To add an extra layer of Cryptography

I would like to store it with a specific password, ex. snow

I can add this in .env like this SALT_PASSWORD=snow

I want to do something like this

encrypt(salt(env('SALT_PASSWORD'), 'eyJhbGciOiJS1234zz'))


so only the people who know the SALT_PASSWORD can decrypt the token.


decrypt(salt(env('SALT_PASSWORD'), 'eyJhbGciOiJS1234zz'))

I'm not sure what I am trying to do is call, or possible in PHP.

Can someone please shed some lights on this ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3uSO1sb
via IFTTT

Aucun commentaire:

Enregistrer un commentaire