Hello Guys! Need help with php mysql database, i want to encrypt the data store in the database but till now i'm just able to encrypt the user id and pwd, so help me with this "I want to encrypt and decrypt the data stored in database". And guide me if i'm trying something wrong. Thanks
Exactly, first the NSA can already decrypt it lol... and 2, off the top of my head you cant print the output from anything without said decryption layer, which in your case, will render this convo useless. You can not decrypt and serve stuff on the fly in any language from JS to C# without it being entirely not secure. Nigel
<?php function encrypt($string) { $string = str_rot13($string); $string = strtolower($string); $string = str_replace('a','1',$string); $string = str_replace('b','2',$string); $string = str_replace('c','3',$string); $string = str_replace('d','4',$string); $string = str_replace('e','5',$string); $string = str_replace('f','6',$string); $string = str_replace('g','7',$string); $string = str_replace('h','8',$string); $string = str_replace('i','9',$string); $string = str_replace('j','0',$string); $string = md5($string); $string = str_rot13($string); $string = str_replace('k','1',$string); $string = str_replace('l','2',$string); $string = str_replace('m','3',$string); $string = str_replace('n','4',$string); $string = str_replace('o','5',$string); $string = str_replace('p','6',$string); $string = str_replace('q','7',$string); $string = str_replace('r','8',$string); $string = str_replace('s','9',$string); $string = str_replace('t','0',$string); $string = md5($string); $string = str_rot13($string); $string = str_replace('u','1',$string); $string = str_replace('v','2',$string); $string = str_replace('w','3',$string); $string = str_replace('x','4',$string); $string = str_replace('y','5',$string); $string = str_replace('z','6',$string); $string = md5($string); $string = str_rot13($string); $string = str_replace('a','>',$string); $string = str_replace('b','<',$string); $string = str_replace('c','@',$string); $string = str_replace('m','$',$string); $string = str_replace('j',';',$string); $string = str_replace('h','[',$string); $string = str_replace('l',']',$string); $string = md5($string); $string = str_rot13($string); $string = substr($string,3,15); return $string; } echo encrypt('johncena'); ?> PHP: The above code is for encryption, which i'm following. But the output of this is in Encrypted form, i want decryption code to decrypt the data for end user.