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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:34:02+00:00 2026-05-12T11:34:02+00:00

When I am encrypting 23 using MD5 encryption I am getting 37693cfc748049e45d87b8c7d8b9aacd this 32-character

  • 0

When I am encrypting 23 using MD5 encryption I am getting 37693cfc748049e45d87b8c7d8b9aacd this 32-character long string which will always be static for 23.

I want the same kind of mechanism but that should generate 18 or less (like: 122ff1e4883358b6) characters long string instead 32.

How I can do that in C#, is there any shorter version of MD5 in c#??

  • 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-12T11:34:02+00:00Added an answer on May 12, 2026 at 11:34 am

    I like @RichieHindle’s answer. However, if you’re interested in losing fewer bits of fidelity (and thereby decreasing the risk of collisions), you could take the 128 bit value returned by the MD5 Hash, and encode it using ASCII85 (also known as Base85 encoding), instead of a hexadecimal-based encoding. This will give you the whole hash in 20 bytes (which is more than you wanted, but you could chop 2 bytes off, resulting in much less loss than removing 14 of the 32 bytes you’d get using hex encoding).

    Edit: Prashant says 20 characters is close enough, and asked for sample code:

    After obtaining the MD5 hash from the MD5.ComputeHash call, you can use Jeff Atwood’s ASCII85 encoder:

    MD5 m = MD5.Create();
    byte[] hash = m.ComputeHash(System.Text.Encoding.ASCII.GetBytes("23"));
    Ascii85 encoder = new Ascii85();
    encoder.EnforceMarks = false;
    string hash85 = encoder.Encode(hash);
    Console.Out.WriteLine(hash85);
    

    Yields

    2ebDPFFZsD?&,r1fX\$,
    

    so you can just use hash85. The encoder.EnforceMarks makes sure that the encoding doesn’t include some typical prefix and suffixes that are associated with ASCII85.

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

Sidebar

Related Questions

For example this encryption function could be called a Utility ? public static string
This question discusses encrypting data on the iPhone using the crypt() function. As an
I am using RijndaelManaged to make a simple encryption/decryption utility. This is working fine,
I'm using md5 encryption for my company salary data. That page should only be
Using hashing algorithms like md5 we suffer from a limited entropy which means that
`I want to encode my string using .net and pass it to a java
I am currently using MD5 encryption for storing the password in the database. We
I am using Jasypt for encryption. This is my code: public class Encryptor {
What is the difference between encrypting some data vs signing some data (using RSA)?
I am using 'RijndaelManaged' and 'CryptoStream' classes in C# to encrypt files. Before encrypting

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.