Hi,
What is more secure ?
Encrypt data using php functions before send it to database (mysql), or
Encrypt directly on database, using encryption functions of database
server ?
Ex:
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
---
$encrypted_data = mcrypt_ecb (MCRYPT_AES, $key, $input,
MCRYPT_ENCRYPT) ;
or
$query = "insert into myTable (text)
values(AES_ENCR YPT('".$input." ','".$key."'))" ;
I think encrypt data directly with php is better because the
information is sent directly encrypted to database server, but i not
sure.
Thanks
What is more secure ?
Encrypt data using php functions before send it to database (mysql), or
Encrypt directly on database, using encryption functions of database
server ?
Ex:
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
---
$encrypted_data = mcrypt_ecb (MCRYPT_AES, $key, $input,
MCRYPT_ENCRYPT) ;
or
$query = "insert into myTable (text)
values(AES_ENCR YPT('".$input." ','".$key."'))" ;
I think encrypt data directly with php is better because the
information is sent directly encrypted to database server, but i not
sure.
Thanks
Comment