Click here to Skip to main content
15,888,008 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have a database in which user's password are stored as encrypted form using asp.net membership provider. here is the setting for membership in web.config

XML
<membership>
     <providers>
       <clear />
       <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
     </providers>
   </membership> 


and the code for encryption is as
C#
System.Text.Encoding.Unicode.GetString(MembershipProvider.DecryptPassword(Convert.FromBase64String(encryptedPassword)));


The Main task is to transfer the mssql database to mysql database. but the problem is the password that are encrypted.
Posted
Updated 20-Oct-14 21:08pm
v2
Comments
Kornfeld Eliyahu Peter 21-Oct-14 3:02am    
Hopefully password doesn't encrypted but stored as a one-way-hash - in which case you can not retrieve it!
Muhammad Taqi Hassan Bukhari 21-Oct-14 3:07am    
I want to retrieve in plain text, so that i can put them back into mysql database through php encryption methods. I have searched on Google and found that if in the configuration file if it's setting is not set to hashed then it can be possible to decrypt it back.

Here is the code that membership using to encrypt the passwords. System.Text.Encoding.Unicode.GetString(MembershipProvider.DecryptPassword(Convert.FromBase64String(encryptedPassword)));

1 solution

We do not condone, support or assist in the production of malicious code in any way, form or manner. This is a professional site for professional developers.

And decrypting database passwords is almost certainly malicious: ask the owner / originator of the password what it is. You do have access to them, don't you?
 
Share this answer
 
Comments
Muhammad Taqi Hassan Bukhari 21-Oct-14 3:14am    
actually the problem is that admin has forget his password in this application, and he also leaves the organization. there is no password recovery option in the product. only change password. but he didn't remember his password. and further more i have decided to move this on MySQL db. so i need to decrypt their password. other wise it is hurle to ask everyone come into the system and change their password.
OriginalGriff 21-Oct-14 3:30am    
If your admin has left and you don't have the password, then you are stuffed.
It may be hassle to get the users to change their passwords, but it's your best option.
Muhammad Taqi Hassan Bukhari 21-Oct-14 3:47am    
yes, but what about the admin password, because on admin module only he has the right to approve the new user's account request. and manage other functionalists and generating reports.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900