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 7541657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:57:04+00:00 2026-05-30T07:57:04+00:00

How do I compare Encrypted passwords that I inserted in the database from the

  • 0

How do I compare Encrypted passwords that I inserted in the database from the users Input? and I notice that while I was testing my program, I’ve created an account where they both have the same password but they have different encryptions, how would I know if the users input is the same as the one in the database? does Encrypto do it that way? or Encrypto has a distinctive way of determining which is which?

and am I using Encrypto right in this code?

var hasher = new Hasher();

hasher.SaltSize = 16;

//Encrypts The password
var encryptedPassword = hasher.Encrypt(txtPass.Text);

Account newUser = new Account();

System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding();

newUser.accnt_User = txtUser.Text;
newUser.accnt_Position = txtPosition.Text;
newUser.accnt_Pass = new System.Data.Linq.Binary(encoding.GetBytes(encryptedPassword));
  • 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-30T07:57:05+00:00Added an answer on May 30, 2026 at 7:57 am

    Two identical passwords can result in different hashes because Encrypto appends a random salt to the end of the password before hashing it.

    On codeplex check out the source code for Hasher.cs to see how they do this. They basically use the salt to do the hash and then append the salt to the end of the hash. this is what you store in the DB.

    When a user sets their password or a new user registers, you hash the password and store it in the DB

    var hasher = new Hasher();
    hasher.SaltSize = 16;
    var hashedPasswordToStoreInDB = hasher.Encrypt(passwordToSet);
    

    Later on when they log in and enter their password you compare the password that the user types to the previously hashed version retrieved from the DB like this

    var hasher = new Hasher();
    hasher.SaltSize = 16;
    bool areEqual = hasher.CompareStringToHash(enteredPassword, hashFromDatabase);
    

    Again, if you look at the source code (Hasher.CompareStringToHash) you will see that the random salt is recovered from the stored hash and then used to compute a new hash from the entered password.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Openfire stores encrypted passwords in a database using blowfish encryption. http://svn.igniterealtime.org/svn/repos/openfire/trunk/src/java/org/jivesoftware/util/Blowfish.java is the java
I have stored user passwords in an encrypted format in my database. However, now
i have table in my database that have senestive data such as password field
Ok now I am confused. I have been getting advice from SO users on
I'm new to Rails and i'm currently learning from tutorials from http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-one#top find_by_email works
I am doing, a webpage that the users will introduce their credit cards and
I want to store profile details encrypted within a database. However, some details should
compare SELECT distinct u_id,timestamp as time FROM my_table; and SELECT distinct u_id,max(timestamp) as time
Compare String.Format(Hello {0}, World); with Hello {0}.Format(World); Why did the .Net designers choose a
Compare these 2 queries. Is it faster to put the filter on the join

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.