Database encryption
MySQL has its own database encryption method, AES_ENCRYPT(), and decryption method, AES_DECRYPT().
We need a key, secret key, to access the encrypted data stored in the database. Without the secret key, it will return NULL.
Example steps:
1. Create a database with BLOB data type (TINY BLOB, MEDIUM BLOB, BLOB).
2. Encrypt: INSERT INTO table (field) VALUES (AES_ENCRYPT('".$_POST['field']."','".$_POST['key']."'));
3. Decrypt: SELECT AES_DECRYPT(field, '".$_POST['key']."') FROM table;
- Forums:
