php - What is the best practice for using AES_ENCRYPT and how secure is it? -


i have been asked research on how form submission data can encrypted , ensure stored securely in database. form submission contain personal details employees , these must kept secure.

i have come across aes_encrypt() during research , have managed apply function stores data in database.

example sql statement used:

"insert employee (firstname) values (aes_encrypt('$name', '$encryption_key'))" 

however, have limited knowledge in area , not sure if sufficient enough protection prevent data being hacked. level of security provide? there have missed or technique use improve implementation?

additionally, have stored encryption key in separate php file not know recommended way store is. advice on appreciated.

sorry if question vague or quite broad. complete beginner in area. happy provide more information if needed.

aes (rijndael) crypto pretty doggone secure. in practice, unless data tremendously valuable, can consider secure. unless actor vast resources decides want crack encryption, nobody will.

but it's symmetric. uses same key encrypt , decrypt stuff. so, can consider secure key.

your key insecure. if cybercreep cracks server running php code, access key. , gives them access encrypted data. , have bright neon road sign saying "here's data think sensitive."

don't forget security depends on weak link. it's considered smarter use money , time secure server, rather use symmetric encryption on few columns of dbms. in other words, respect, you're wasting time doing column based encryption.

if absolutely must encrypt data @ rest, should consider using asymmetric (public / private key) cryptosystem. encrypt stuff using public key, , keep private key on airgapped secure system in case need decrypt data.

your example (first name) isn't sensitive enough worth trouble.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -