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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:09:10+00:00 2026-06-15T20:09:10+00:00

If i generate a MD5 hash of a string and then truncate it to

  • 0

If i generate a MD5 hash of a string and then truncate it to 25 characters, will it be possible to bruteforce it? Is it comparatively safe as salting the hash?

  • 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-15T20:09:12+00:00Added an answer on June 15, 2026 at 8:09 pm

    I’m not a crypto expert but I would imagine truncating would be somewhat similar to salting. When you salt, your padding your input data with random data, then generating a hash value. So essentially,

    hash = md5(pass + salt)
    

    This random salt obviously affects the hash value returned, so if you had “password” as your password, with a salt, your hash value would be completely different than the hash value derived from the password, “password” without salt added. That being said, an attack would need to guess how the salting was implemented, and then brute force the salt/password combo. So the attacker would have to know where in the string the salt was placed, so was it…

    hash = md5(salt + pass) or hash = md5(pass + salt) ?
    

    If they can guess that somehow, they would then need to brute force password + salt values.

    hash = md5(password + 1)
    hash = md5(password + 2)
    hash = md5(password + 3)
    ....
    hash = md5(password + ;fioja4ofu4fioaejfio)
    ....
    hash = md5(password2 + 1)
    ....
    

    Extremely computationally intensive!

    So if you truncate your hash, there is still some guess work to be done, albeit not as much work perhaps. Consider the md5 hash value you get, you change just a few characters and your hashes change seemingly completely.

    For instance,

    cat = d077f244def8a70e5ea758bd8352fcd8
    cat1 = a980d10665f268b0ec6c13ebea43034f
    

    It is safe to say that most inputs will have an exclusively unique hash value. If your truncation was static, lets say, truncate from 32 characters to 25. The attacker is going to need to know where and how the truncation happens. Is it sliced from the end or front? Randomly picked from the hash? However, given that the hash values will generally be very different you could implement some probabilities.

    For instance, take the cat hash. I truncate 7 characters from the end…

    cat = d077f244def8a70e5ea758bd8352fcd8
    cat = d077f244def8a70e5ea758bd8
    

    Given the fact that these hashes generally vary completely, the truncation wouldn’t help a whole lot. I could write a short script that would check your truncated hashes against full hashes of random input data to see if there is a x% match or something. If I hashed cat, and your truncated hash matched 25 out of 32 characters of my cat hash, I would say with great certainty that your truncated hash is for the word cat, and I would just fill in the truncated part with the rest of my cat hash.

    Everything I said here is just me spit balling in my mind. I am no crypto/security expert by any means. I just dabble with random security stuff. Take it or leave it 🙂 Hope it brings some clarity.

    Soooo, I would much rather implement my own salting solution, than truncate. If your looking to truncate to save a few bytes of room, implement salt than truncate!

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

Sidebar

Related Questions

I have a method that hash input string to generate MD5 pass from it
Possible Duplicate: Generate a Hash from string in Javascript/jQuery Can anyone suggest a simple
Possible Duplicate: Reversing an MD5 Hash Given this method in c# public string CalculateFileHash(string
Possible Duplicate: Generate MD5 hash in Java Hi, I want to compute the MD5
Is there a way to generate MD5 Hash string of type varchar(32) without using
Possible Duplicate: Generate MD5 hash in Java Can some one tell me how to
Is there any method to generate MD5 hash of a string in Java?
I generate a MD5 Hash from a String and from a File Containing the
when using oracle forms to generate md5 hash, i get result that is different
i use Force MD5 encryption of the password in htpasswd to generate a hash

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.