ven.ganeva Posted October 13, 2008 Share Posted October 13, 2008 Hi I have a load of data in a database and want to convert a varchar field to an md5 password field. Is there some kind of query i can run? Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/ Share on other sites More sharing options...
revraz Posted October 13, 2008 Share Posted October 13, 2008 VARCHAR will support a MD5 PW just fine. Is it 40 char length? Or do you mean you want to convert all the data into a MD5 hash? Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-663968 Share on other sites More sharing options...
PFMaBiSmAd Posted October 13, 2008 Share Posted October 13, 2008 He probably as a huge list of common words that he wants to store the md5 of to make a md5 lookup table. Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-663971 Share on other sites More sharing options...
ven.ganeva Posted October 13, 2008 Author Share Posted October 13, 2008 Yeah basically there is a table which holds user data and currently it holds their passwords in a non encrypted format which is very bad. So i just wanted to keep all the passwords the same but to apply MD5 encryption to them so that the data is more secure. Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-663986 Share on other sites More sharing options...
trq Posted October 13, 2008 Share Posted October 13, 2008 UPDATE tbl SET passwd = MD5(passwd); Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-663988 Share on other sites More sharing options...
ven.ganeva Posted October 13, 2008 Author Share Posted October 13, 2008 UPDATE tbl SET passwd = MD5(passwd); Erm... wont this set everyone's password to "passwd"?? Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-663992 Share on other sites More sharing options...
DarkWater Posted October 13, 2008 Share Posted October 13, 2008 No, you need to change passwd (in both places) to the name of your password column. Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-663994 Share on other sites More sharing options...
ven.ganeva Posted October 13, 2008 Author Share Posted October 13, 2008 Brilliant thank you! Link to comment https://forums.phpfreaks.com/topic/128202-solved-convert-strings-to-md5-passwords/#findComment-664001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.