How is .net generating extra bits in MD5?

From: Pete (jpeteb_at_hotmail.com)
Date: 01/21/05

  • Next message: Valery Pryamikov: "Re: How is .net generating extra bits in MD5?"
    Date: 21 Jan 2005 11:53:48 -0800
    
    

    Hi,

    I have a piece of .net code I am trying to understand. It creates a MD5
    hash then requests 256 bits from the hash, where MD5 only generates 128
    bits. I've looked at the hash with another non-.net piece of code and
    the first 128 bits match up correctly. How is Microsoft creating the
    second 128 bits? I cannot seem to figure that out. Here is a code
    fragment in C#:

    string passPhrase; // password string
    string saltValue; // salt string
    string hashAlgorithm; // set to "MD5"
    int passwordIterations; // set to 2
    int keySize; // set to 256

    byte[] initVectorBytes = Encoding.ASCII.GetBytes(initVector);
    byte[] saltValueBytes = Encoding.ASCII.GetBytes(saltValue);

    PasswordDeriveBytes password = new PasswordDeriveBytes(
    passPhrase,
    saltValueBytes,
    hashAlgorithm,
    passwordIterations);
    byte[] keyBytes = password.GetBytes(keySize / 8);

    TIA for any help.


  • Next message: Valery Pryamikov: "Re: How is .net generating extra bits in MD5?"

    Relevant Pages

    • Re: Rand generator (MD5)
      ... My micro cannot handle anything more than 32 bits! ... YOu do not have MD5. ... It does not sound to me like your hash implimentation is very ... void byteReverse(unsigned char *buf, unsigned longs); ...
      (sci.crypt)
    • Re: Rand generator (MD5)
      ... My micro cannot handle anything more than 32 bits! ... YOu do not have MD5. ... It does not sound to me like your hash implimentation is very ... void byteReverse(unsigned char *buf, unsigned longs); ...
      (sci.crypt)
    • Re: "Collision for Hash Functions MD4, MD5, HAVAL-128 and RIPEMD"
      ... this was the Year of Doom for cryptographic hash functions. ... These go into great detail on the SHA-0 and MD5 collisions ... Difficulty in the former is called "collision resistance", ... you probably meant to say was "I can find a *different* string whose ...
      (comp.os.linux.security)
    • Re: Possibility to cheat integrity checking?
      ... No. Weaknesses have been found. ... I won't claim that you're -wrong- for continuing to use MD5 for file ... as a secure hash function. ... >criteria's for AES is that the cipher should be easily useable as a ...
      (Focus-IDS)
    • Re: Complex Theoretical One Way Hash Question
      ... is an MD5 of the modified image including the readable MD5. ... image (I don't mean a JPEG tag, I mean literally on the image canvas ... is unable to attack the hash, though a formal proof is out of my grasp. ... a public "ihash" function that accepts any file (including ...
      (sci.crypt)