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

  • Home
  • SEARCH
  • 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 5959615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:42:36+00:00 2026-05-22T18:42:36+00:00

I am creating a login screen for an application in C#. In my login

  • 0

I am creating a login screen for an application in C#. In my login screen I am reading the username and password from the database and checking whether the entered username and password are correct or not. I need the password to encrypt while I am reading the password form the database. Can anyone explain how encryption and decryption works.

  1. Whether I have to store the encrypted value in the database for reading.
  2. Right now I have two fields

    column names: username         password 
    
    values:        admin            password
    
  3. Should I store the encrypted value of the password in another field in the login table?

  • 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-22T18:42:37+00:00Added an answer on May 22, 2026 at 6:42 pm

    First: The common approach now is that store the salted hash of the password, instead of the plain-text password itself (SHA-1 and better hashing algorithm are preferred, avoid MD5 because it’s not safe any more) . When the user login, you recalculate the hash of the input string, then compare it with string stored in the database.

    EDIT: why shouldn’t you use encryption for password? Because when the attacker knows the key of encryption, all of you passwords will be exposed (That’s very bad). If you using hash, he just can guess one-by-one (and this is not easy). Otherwise, hash algorithms, in general, are faster then encryption, you’ll take the performance benefit.

    EDIT: why you should store salted hash, instead of a hash? Because hashing algorithms are guaranteed that if you hash identical strings, the result is the same. This may lead to a problem is that, when attacker see the same hash values, he can guess that the texts were the same, and this gives chance for him to get the original password.

    Salt means that besides the original text, you put some random text, and therefore, two identical strings will generate different hash values

    Take a look at this: http://www.obviex.com/samples/hash.aspx

    In case of the user forgets his password, you can use the reset password function, which many sites are using:

    1. The user requests a password reset
    2. An email contains a special link (include a secret token/PIN) will be sent to registered email address, that allows user to reset his password.
    3. A randomly created password will be sent again to user, then he can login and change his password.

    UPDATE May 14th 2012: The answer seems to be old, and not completely true. People are moving to more secure hashing-encryption algorithm for storing password. One of notable solution now is bcrypt, and another (new and promising) is scrypt.

    The advantage of these encryption? They’re slow! Much slower than hashing algorithm. With the power of GPU (for example, CUDA from nVidia), cracking the hash value is not impossible now, and the slowness can make it much harder to crack these encryption.

    You can find more about bcrypt at: http://codahale.com/how-to-safely-store-a-password/

    Second: You should separate the users table (contains user profiles, such as full name, DoB, address,…) and logins table (Which contains user name and password, and some special attributes). This will lead to better management and reduce the risk of exposing sensitive information

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

Sidebar

Related Questions

HI, i am creating an login screen to my iphone application. i am sending
I'm creating an application in Qt (Nokia SDK) which should hold a login screen,
I am creating a login page for my web application. I want to create
I am implementing android application which is on web service. I'm creating login Activity
I'm creating an application whose main screen can consist of one of three Scenarios.
I'm creating a login form that's loaded from a nib. I have several NSTextFields,
I'm creating a login page. I want to create ASP.NET TextBox controls that have
I'm creating a control and need to pass it the current logon user as
When creating a web application, and lets say you have a User object denoting
I am creating a new Silverlight 4 business application using RIA services. This will

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.