I'm trying to integrate a user database, in which passwords were generated by PHP MD5() function and are 32-character hexadecimal numbers like "4e782c983e2a4c7986e48c799ec63aea". The following snippet makes strings like "J2A6frYm+pbznpYZCH0QB8kkxZM=" equally, no matter what type, MD5 or SHA1. Looks like hashAlgorithmType attribute is ignored.
Umbraco: 4a3241366672596d2b70627a6e70595a4348305142386b6b785a4d3d (ASCII: J2A6frYm+pbznpYZCH0QB8kkxZM=) <-- seems like it's sha224 using some key. There's no other way but to change the source, I guess.
Solved by changing the encodePassword functions of the umbraco.cms.businesslogic.member.Member and umbraco.providers.members.UmbracoMembershipProvider classes to:
case MembershipPasswordFormat.Hashed: byte[] pass = Encoding.UTF8.GetBytes(password); MD5 md5 = new MD5CryptoServiceProvider(); encodedPassword = BitConverter.ToString(md5.ComputeHash(pass)); encodedPassword = (encodedPassword.Replace("-", "")).ToLower(); break;
MD5-encrypted member passwords
I'm trying to integrate a user database, in which passwords were generated by PHP MD5() function and are 32-character hexadecimal numbers like "4e782c983e2a4c7986e48c799ec63aea". The following snippet makes strings like "J2A6frYm+pbznpYZCH0QB8kkxZM=" equally, no matter what type, MD5 or SHA1. Looks like hashAlgorithmType attribute is ignored.
What can be done to make md5 passwords?
Thank you.
You just need to set the passwordFormat="Hashed" on the provider like is shown here: http://our.umbraco.org/wiki/how-tos/membership-providers/umbracomembershipprovider-properties
I'm pretty confident that hashed passwords are generated using MD5.
Thanks, slace, but it doesn't help.
Actually, I'm not sure which encryption is used anymore. Here is what I found using online encrypters with a string "bakabaka":
md5: 4e782c983e2a4c7986e48c799ec63aea <-- is what in my PHP database and what i want to get from Umbraco
sha1: c60489d8262d3d090b947541526605e8bad0eed6
sha224: e426508d19c6d4a9c813861c54415ac71fc5511032d6681696f0e060
Umbraco: 4a3241366672596d2b70627a6e70595a4348305142386b6b785a4d3d (ASCII: J2A6frYm+pbznpYZCH0QB8kkxZM=) <-- seems like it's sha224 using some key. There's no other way but to change the source, I guess.
Solved by changing the encodePassword functions of the umbraco.cms.businesslogic.member.Member and umbraco.providers.members.UmbracoMembershipProvider classes to:
Here's the code from the membership provider:
So I guess that answers the question of encrypting ;)
is working on a reply...