Quantcast
Channel: Security
Viewing all articles
Browse latest Browse all 4737

SQLMembership to Identity 2.0 - old encrypted passwords

$
0
0

I've migrated a SQLMembership database into an Identity 2.0 database.

My old database used encrypted passwords. My identity 2.0 implemenation will use hashed password.

My SQL script inserted into the new PasswordHash field using this:

(aspnet_Membership.Password+'|'+CAST(aspnet_Membership.PasswordFormat as varchar)+'|'+aspnet_Membership.PasswordSalt)

I then override the VerifyHashedPassword method to Split('|') it up.... if it splits into three parts it's an old password.

I need a method to encrypt the password being attempted to compare it to the old aspnet_Membership.Password. Not sure how to do this. As you see I have the old salt and the old hashed password. 

If the password is correct, I then approve the authentication and reset the password using the new format.

Alternatively, if I could unencrypt and re-hash the passwords in my SQL script... that would probably be easier?

I hope this makes sense.


Viewing all articles
Browse latest Browse all 4737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>