Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7006689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:30:34+00:00 2026-05-27T21:30:34+00:00

It is encypted in the table. I don’t want to reset the password. I

  • 0

It is encypted in the table. I don’t want to reset the password.
I got a solution at here

But I am not sure the namespace of

base.DecryptPassword

Because I got an error, can not find it.

Updated again:

updated my code:

public class FalseMembershipProvider: MembershipProvider
{
    public string GetPasswordAnswer(Guid providerUserKey)
    {
        Microsoft.Practices.EnterpriseLibrary.Data.Database db = Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase();
        using (System.Data.Common.DbCommand cmd = db.GetSqlStringCommand("SELECT PasswordAnswer FROM aspnet_Membership WHERE UserID=@UserID"))
        {
            db.AddInParameter(cmd, "@UserId", DbType.Guid, providerUserKey);
            object answer = db.ExecuteScalar(cmd); if (answer != null)
                return ProviderDecryptor(answer.ToString());
            else
                return null;
        }
        db = null;
    }
    internal string ProviderDecryptor(string encryptedText)
    {
        string decrypted = null;
        if (!string.IsNullOrEmpty(encryptedText))
        {
            byte[] encodedbytes = Convert.FromBase64String(encryptedText);
            byte[] decryptedbytes = base.DecryptPassword(encodedbytes);
            if (decryptedbytes != null)
                decrypted = System.Text.Encoding.Unicode.GetString(decryptedbytes, 16, decryptedbytes.Length - 16);
        }
        return decrypted;
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:30:35+00:00Added an answer on May 27, 2026 at 9:30 pm

    The class is inheriting from the MembershipProvider class. The method being called is MembershipProvider.DecryptPassword. However, as you can see on the MSDN page, it’s a protected method. By inherting from MembershipProvider, this new class can use base.DecryptPassword which is essentially saying “call the DecryptPassword method of the MembershipProvider. Even though the method is protected, I can call it because I have permission since I’m inheriting from the MembershipProvider class”.

    The class you’re writing needs to inherit from MembershipProvider as the author did in their example:

    public class FalseMembershipProvider : MembershipProvider
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my table: Id Password Status 1 a6cc890.. 1 I have a trigger
I have a users sql server table and I want to make password encrypted
I encrypted my password field and inserted it into a MySQL table. After that
i have table in my database that have senestive data such as password field
I have a table called login with a username and password both encrypted by
I have a user auth table with a few thousand records containing a password
i need to use base 64 to encrypt some data. but while everyone can
Essentially I've got a table holding user data, all of which is AES encrypted
I have a table User and a table Profile. Here's what I have in
I have a table TblUserLogin with columns LoginID int , Password varchar(50) , LoginUserName

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.