Reputation: 45
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
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