MD5 encryption

6 posts by 2 authors in: Forums > CMS Builder
Last Post: February 9, 2009   (RSS)

By IronVictory - February 6, 2009

As I understand reading in a previous thread, there is no functionality to save data encrypted as MD5. Is there a workaround I can use to add a field to MySQL capable of holding MD5 data? I am fairly comfortable with PHP. I see there is an option for a "password" field, but the password will still be saved as text?

thanks

Re: [IronVictory] MD5 encryption

By Dave - February 6, 2009

Hi IronVictory,

There's nothing built in, but there might be a workaround. What are you trying to do?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] MD5 encryption

By IronVictory - February 6, 2009

I am building a member area where users can login to view their profile, etc. I have set up text fields in CMSB to store their username and password but of course they are stored as plain text. I would like to store the password encypted.

thanks

Re: [IronVictory] MD5 encryption

By Dave - February 9, 2009

Hi IronVictory,

There's now way to switch the default method that CMS Builder uses internally, but if you are writing add on script and forms to work with the mysql data you can encode a password as MD5 in MySQL like this: SELECT MD5("hello world");

or in PHP like this: md5("hello world");

Usually when we write edit/view profile sections on a site we have that as a separate script that loads the MySQL data rather than letting the website visitors access the CMS. It depends on the site though.

If you wanted to create a new column in the accounts database table called "password_md5" you could create an MD5 value for each password with this MySQL:

UPDATE cms.cms_accounts SET password_md5 = MD5(password)

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [IronVictory] MD5 encryption

By Dave - February 9, 2009

There's no way for it to be saved within the CMS, no.

One last idea... If you're able to update your member area script, though, you could have it convert the password on the fly to MD5 either in PHP or MySQL for comparison.
Dave Edis - Senior Developer
interactivetools.com