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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:23:27+00:00 2026-06-13T10:23:27+00:00

A client program (over which I have no control) is authenticating by sending me

  • 0

A client program (over which I have no control) is authenticating by sending me a password, hashed as SHA1(password).

I’m reluctant to store the password hashed using only SHA1 in my database, so I’m proposing to store passwords in the database hashed as SHA256(SHA1(password)) (where the password is hashed over multiple iterations using PBKDF-2 or something similar).

My question is: is there anything insecure about the inner-most hash using SHA1 in this scenario? I realise that the probability of collisions will be increased, but since this is just for storing passwords in the database I don’t think I need to be concerned about that. Is there anything else that I’m missing?

  • 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-06-13T10:23:29+00:00Added an answer on June 13, 2026 at 10:23 am

    Consider adding a salt which is unique-per-row before doing the final encryption. Example:

    Lets say that you receive W6ph5Mm5Pz8GgiULbPgzG37mj9g= (a SHA1’d encryption of "password"). That is associated with a User, who should have a unique key, such as a UserID and/or UserName.

    My suggestion – to avoid collision – would be to do a conversion of the Bytes to a Base64String (in C# this would be Convert.ToBase64String( byteVariable ) – then concatenate onto the string the user’s unique-ID (making the new string something like:

    W6ph5Mm5Pz8GgiULbPgzG37mj9g=+103 (where I added +103 to reflect the user’s ID) – then apply your SHA256 algorithm. This will produce: mNXRjWsKJ7V+BHbAuwJJ7neGT+V1IrLQSQXmb4Vv1X8= – which you can store in your database. A SHA256 hash – which eliminates the collisions from the less-safe SHA1 algorithm.

    And – since you are using 1-way encryption – when you go to check whether the password is valid in the future, you simply append the user’s ID again before checking.

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

Sidebar

Related Questions

I have a program with a Mono-based C# client and a Python server, which
I have an application which get copied and run on client machines. The program
I have a Client program by tcp connection that send data to a server.
I have a client program written in .NET 2.0, that connects to the web
I have a client program that consumes a web service. It works quite well
I am creating a client program that talks to a server (which I programmed).
I have written an ActionScript client program that tries to connect to a local
I have a client/server program in TCP written in C, and I would like
I'm writing a program that will have both a server side and a client
I have simple client/server SSL code which worked fine on Python 3.2. However, I

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.