Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can I encrypt and decrypt a data present in Mysql table using Mysql?

user-image
Question added by Feras Abualrub , Web Solutions Manager , Qistas for Information Technology
Date Posted: 2013/09/09
Nidhin EswaranKomath
by Nidhin EswaranKomath , Senior Software Engineer , Robosoft Technologies Pvt Ltd

Use AES_ENCRYPT (),AES_DECRYPT() functions in mysql for encryption and decryption.

example:

insert into landb.login (id, username, password )values(123, '12',AES_ENCRYPT ('nidhinek','nixpass'))

select AES_DECRYPT(landb.login.password, 'nixpass') from login where id=123

Output:nidhinek

Deleted user
by Deleted user

There's a library from php for encryption which is php5_mcrypt. Try to read it in PHP documentation and it's very easy.

mohammed al shareif
by mohammed al shareif , Team Leader , Beecell

check the php library for encoding and decoding , all what you need to install the library on server and just call a php function ....i think you can add salt for the encribtion 

Marouen Sayari
by Marouen Sayari , Senior PHP Programmer and Full-time Freelancer, Zend Certified Engineer , Self-employed

Generally, reversible encryption functions (like AES_ENCRYPT and ENCODE) are deprecated since their attack as much easier than irreversible functions.

 

Try using irreversible function instead.Example

 

SHA1, MD5

More Questions Like This