Zabs
Zabs

Reputation: 14142

using AES_DECRYPT to get data

I am trying to retrieve data from a table from some old legacy work, the Email field all have '[BLOB - 32 B]' in the fields therefore has been encrypted - can anyone explain how I use the AES_DECRYPT to collect the actual email address from this table?

I have the AES_PASSWORD in var stored already within one of the common functions.

Upvotes: 0

Views: 310

Answers (1)

Tarang
Tarang

Reputation: 75945

Where $key = AES_PASSWORD (Your key for the data)

Your SQL would be

$sqlinsert = "INSERT INTO tblemail (email) VALUES (AES_ENCRYPT('$email','$key'))";

$sqlget = "SELECT AES_DECRYPT(email,'$key') from tblemail;";

Upvotes: 1

Related Questions