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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:45:05+00:00 2026-05-11T03:45:05+00:00

I have a website where users can upload their files; these are stored on

  • 0

I have a website where users can upload their files; these are stored on the server and their metadata recorded in a database. I’m implementing some simple integrity checks, i.e. ‘is the content of this file now byte-for-byte identical as when it was uploaded?’

An example: for content of userfile.jpg, MD5 hash is 39f9031a154dc7ba105eb4f76f1a0fd4 and SHA-1 hash is 878d8d667721e356bf6646bd2ec21fff50cdd4a9. If this file’s content changes, but has the same MD5 hash before and after, is it probable that the SHA-1 hash will also stay the same? (With hashing, sometimes you can get a hash collision – could this happen with two different hashing algorithms at once?)

Or is computing two different hashes for a file pointless (and I should try some other mechanism for verifying integrity)?


Edit: I’m not really worried about accidental corruption, but I’m supposed to prevent users changing the file unnoticed (birthday attack and friends).

I’ll probably go with one hash, SHA-512 – the checks don’t happen that often to be a performance bottleneck and anyway, ‘As Bruce Schneier says, there’s enough fast, insecure systems out there already. –@MichaelGG in the comments’.

  • 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. 2026-05-11T03:45:06+00:00Added an answer on May 11, 2026 at 3:45 am

    MD5 is probably safe for what you’re doing, but there’s no reason to continue to use a hash with known flaws. In fact, there’s no reason you shouldn’t be usign SHA256 or SHA512, unless you have some known major performance bottleneck.

    Edit: To clarify, there’s no reason to use two algorithms; just use one that fits what you need. If you’re worried about people doing MD5 collisions on you (as in, is this a security threat?), then use an algorithm that isn’t as weak, such as SHA256.

    Edit 2: To address an apparently still common misunderstanding: Finding a random collision on a hash is not a 1/2^n probability. It’s closer to 1/2^(n/2). So a 128-bit hash can probably be collided with 2^64 attempts. See birthday attack for details.

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

Sidebar

Related Questions

We have some files on our website that users of our software can download.
I have a website that shows galleries. Users can upload their own content from
I have a website and going to extend it, so users will upload their
I have a website where the users can upload an image. However, before they
I have a website were users can create a profile and upload an image
I am using PHP for a website. I have to get users upload their
I have a website where users sign up and get to upload their images
I have multiple themes on my website and users can just switch between multiple
I want my website to have a checkbox that users can click so that
I want to create a website with various users. The users can have different

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.