Decrypting data in a MySQL table using a standard query and a BS4 Table

HI all,
Please can someone help as I’m chasing my tail.

I have created a database table on a MySQL server, two of the data fields contain sensitive information.
when posting to the database i can encrypt with password and the data appears on the server encrypted.

Problem is now I want to decrypt when retrieving the data in a query but i do not have the option within the query builder to decrypt with password so cant view the data on the client screen.
I understand that SHA with salt and hash is one way but by password is supposed to be both…

Thanks in advance

I haven’t used this feature, but I expect you could create a repeat after the query, selecting the fields to output, and then create a variable inside the repeat, using the fields returned by the query, with the Decrypt with Password formatter applied.

Hello… I just did it for a project of mine

Hash is only one way encryption and it is done with this intent.

I.e.: you can compare the hash of a password with the hash in the database and if they match, give access.

To encrypt and decrypt you must use on server connect different option:

On database Insert, you must encrypt the $_POST.message (in this example input is called “message” as following:

Select message and open the right datapicker

Click on “+” and choose: Cryptographic > Encrypt with Password

Then you put the password to encrypt (that must be same for decrypt).

And you encrypt message data inserted on the DB table

To decrypt:

database query step: as usual,
then add a repeat (with condition the query itself) and add a “Set Value”

Select the repeat field that’s encrypted and

The final server connect is as follow:

Schermata 2021-03-18 alle 18.17.07

If something not clear just ask

1 Like

That’s amazing thank you very much for your help.

1 Like