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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:06:40+00:00 2026-05-24T01:06:40+00:00

I am building a web front end app, which has a table users and

  • 0

I am building a web front end app, which has a table users and ofcourse a username and password field. My Question is what datatype should I store the password as :

I was told binary is popular, but how do I store the password as binary i.e. on the front end if I capture the password from login form how do I transform that string to binary.

Any Suggestions would be appreciated!

  • 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-24T01:06:40+00:00Added an answer on May 24, 2026 at 1:06 am

    You have to basically hash your passwords and store them in the database. You never decrypt them back but always compare the hashed versions. Some sample stuff is below.

    private static string CreateSalt(int size)
      {
       //Generate a cryptographic random number.
       RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
       byte[] buff = new byte[size];
       rng.GetBytes(buff);
    
       // Return a Base64 string representation of the random number.
       return Convert.ToBase64String(buff);
      }
    
    private static string CreatePasswordHash(string pwd, string salt)
      {
       string saltAndPwd = String.Concat(pwd, salt);
       string hashedPwd = 
        FormsAuthentication.HashPasswordForStoringInConfigFile(
        saltAndPwd, "sha1");
    
       return hashedPwd;
      }
    

    Store the PasswordHash and salt in the database in the user’s account.

    Then, when the user attempts to logon the next time, grab the salt from the database and hash it as usual with the password provided by the user during logon and compare that value to the PasswordHash in the database. If they are the same, the user provided the correct password (whatever that may be). If they are not the same, the password entered was incorrect.

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

Sidebar

Related Questions

I am building a application that services users via a web front end, which
I am building an application that has a web front end and a desktop
I'm building a web application where the front end is a highly-specialized search engine.
I'm researching the idea of building a super-small (preferably PHP) web app, which will
question: i'm building (or trying to build) a front end for an enterprise level
I am trying to get into web development, specially interested building the front-end, UI
I am building a web-based application. The frontend has been designed in Sproutcore. For
I'm a lead developer on a project which is building web applications for my
I'm building a (Rails-based) web service with a mobile app (iPhone) as frontend. In
I want to build a web based front-end to manage/administer my Linux box. E.g.

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.