Jump to content

[SOLVED] AES_ENCRYPT / DECRYPT


black.horizons

Recommended Posts

so...how would i use these on any of my tables. if i needed to encrypt and decrypt several fields. could you show me an insertion, update and selection statement of these?

$insertinfo = mysql_query("INSERT INTO team_info VALUES ('NULL','$travel','$notes','$fixture,'$timestamp'')");

NULL is a mysql auto_increment value

$updateinfo = mysql_query("UPDATE team_info SET travel='$new_travel', notes='$new_notes', fixture='$new_fixture', TimeStamp='$timestamp' WHERE (team_id='$id')");

$selectinfo = mysql_query("SELECT travel, notes, fixture, TimeStamp FROM team_info WHERE (team_id='$id')");
  • 3 months later...
thanks all, heres how i did it: (field names and key changed!)

$user_info = mysql_query("SELECT AES_DECRYPT(address1, 'yugbfmdhkdfk8657698') as address1, AES_DECRYPT(townland, 'yugbfmdhkdfk8657698') as townland, AES_DECRYPT(postcode, 'yugbfmdhkdfk8657698') as postcode, AES_DECRYPT(homephone, 'yugbfmdhkdfk8657698') as homephone, AES_DECRYPT(mobilephone, 'yugbfmdhkdfk8657698') as mobilephone FROM userinfo WHERE (id='$id')");

works super!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.