praad
praad

Reputation: 45

Table Encryption in mysql

Is it possible to encrypt an entire table, not just a specific column in MySQL? I'm also using Drupapl & PHP.

Upvotes: 0

Views: 72

Answers (1)

Vikram Jain
Vikram Jain

Reputation: 5588

Just using "AES_ENCRYPT" for ENCRYPTwhen you insert a record.

 INSERT INTO table (mycolumn) VALUES(AES_ENCRYPT('Hello!', 'encryption_key'));

And using "AES_DECRYPT" for DECRYPT when you insert a record.

   SELECT AES_DECRYPT(mycolumn, 'encryption_key') FROM table;

Upvotes: 1

Related Questions