View Full Version : encrypt and decrypt script
hards
09-18-2007, 06:56 AM
Hi all
I'm a Newbie in (php, SQL, html, apache), I been working in vb :eek:
now i's time to go on the web
I'm making a script that encrypt and decrypt text for info in a database.
would someone please post a link to some scripts, or better yet (some good tutorials), so I can make my own.
For Security, making my own is the only way. ;)
Stimulus
09-18-2007, 06:11 PM
well, for passwords, you can insert them into mysql this way:
mysql_query("INSERT INTO passwordColumn VALUES(PASSWORD("Password to encrypt"))");
Other than that, you can use md5() and crypt() in php to do it
fenderocker
09-18-2007, 07:39 PM
Hi all
I'm a Newbie in (php, SQL, html, apache), I been working in vb :eek:
now i's time to go on the web
I'm making a script that encrypt and decrypt text for info in a database.
would someone please post a link to some scripts, or better yet (some good tutorials), so I can make my own.
For Security, making my own is the only way. ;)
do you need to be able to compare the hashes or do you actually need to decrypt them?
If not, you can always just use the md5 php function, which is one way encryption, meaning it's comparable but not decryptable.
hards
09-20-2007, 06:53 AM
Thank you for the replys
Actually,
I need to decrypt them.
encrypt and decrypt text files, not database
Filius nullius
09-28-2007, 02:46 PM
If you want a simple encryption method for text files try to develop your own form of XOR encryption; It's very simple in that it is bidirectional meaning that you can encrypt and or decrypt simply by reversing the process. I think of XOR as a more advanced practical ROT
Mursalat
03-27-2008, 09:38 AM
why not simply use the md5() function?
Actaully the shai() is much safer the md5, so I suggest doing this:
$var = sha1(md5($var));
And then make it more complicated. ;)
$var = sha1(md5(sha1(md5(sha1(md5($var))))))
Miami
03-29-2008, 10:36 AM
sha1(md5()) is enough. anymore is over kill. those algorithms use alot of resources so...
anyway in answer to the first post.. use base64 encoding. u can decrypt it also. be aware though that its easy to recognise a base64 encoding because it has a "=" at the front
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.