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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:18:48+00:00 2026-05-31T19:18:48+00:00

My company uses the following algorithm to hash passwords before store it in the

  • 0

My company uses the following algorithm to hash passwords before store it in the database:

    public static string Hash(string value)
    {
        byte[] valueBytes = new byte[value.Length * 2];

        Encoder encoder = Encoding.Unicode.GetEncoder();
        encoder.GetBytes(value.ToCharArray(), 0, value.Length, valueBytes, 0, true);

        MD5 md5 = new MD5CryptoServiceProvider();
        byte[] hashBytes = md5.ComputeHash(valueBytes);

        StringBuilder stringBuilder = new StringBuilder();

        for (int i = 0; i < hashBytes.Length; i++)
        {
            stringBuilder.Append(hashBytes[i].ToString("x2"));
        }

        return stringBuilder.ToString();
    }

To me it sounds like a trivial md5 hash, but when I tried to match a password (123456) the algorithm gives me ce0bfd15059b68d67688884d7a3d3e8c, and when I use a standard md5 hash it gives me e10adc3949ba59abbe56e057f20f883e.

A iOS version of the site is being build, and the users needs to login, the password will be hashed before sent. I told the iOS team to use a standard md5 hash, but of course it don’t worked out.

I can’t unhash the password and hash it again using the standard md5 (of course), and I don’t know what exactly tell to the iOS team, in order to get the same hash.

Any help?

  • 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-31T19:18:49+00:00Added an answer on May 31, 2026 at 7:18 pm

    You need to use the same encoding on both ends (probably UTF8).

    If you replace your code with

    byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes("123456"));
    

    , you’ll get e10adc3949ba59abbe56e057f20f883e.

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

Sidebar

Related Questions

I uses Rails erb to create links, like the following: <% link_to item_path(topic.company, topic,
My company uses Accurev for source control, and for all its benefits, there's one
The software my company uses has a web service which signature is more or
So my company uses Castle Windsor IoC container , but in a way that
I am new to the dvcs world. My company uses perforce and I'm not
I met a problem which is very strange, my company uses Visual Source Safe
The UNIX department of my company currently uses CVS as source-version control system. They
I have an old project at our company that uses shell scripting a lot.
I'm working on a project for my company that uses a socket server (php)
The company I work for uses a large Jenkins server with a large number

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.