Re: How is .net generating extra bits in MD5?
From: Shawn Farkas [MS] (shawnfa_at_online.microsoft.com)
Date: 01/26/05
- Next message: kishore: "Padding issue with C++ Crypto RC2 encryption"
- Previous message: savanted1_at_hotmail.com: "RE: Permissions Questions"
- In reply to: Pete: "Re: How is .net generating extra bits in MD5?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 26 Jan 2005 18:38:23 GMT
Right ... PasswordDeriveBytes does extend beyond the MD5 hash using an
algorithm similar to:
1. Reset the hash
2. Increment a prefix (starting with byte[] { (byte)'0', (byte)'0',
(byte)'0'} )
3. If the prefix wraps around (gets bigger than 999), fail
4. Hash prefix + original hash
You can try that out and see if it works for you.
-Shawn
http://blogs.msdn.com/shawnfa
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Note:
For the benefit of the community-at-large, all responses to this message
are best directed to the newsgroup/thread from which they originated.
--------------------
> From: "Pete" <jpeteb@hotmail.com>
> Newsgroups: microsoft.public.dotnet.security
> Subject: Re: How is .net generating extra bits in MD5?
> Date: 25 Jan 2005 17:59:26 -0800
> Organization: http://groups.google.com
> Lines: 26
> Message-ID: <1106704766.258159.4510@f14g2000cwb.googlegroups.com>
> References: <1106337228.327388.91720@z14g2000cwz.googlegroups.com>
> <8Z$30uyAFHA.2504@cpmsftngxa10.phx.gbl>
> NNTP-Posting-Host: 24.61.90.30
> Mime-Version: 1.0
> Content-Type: text/plain; charset="iso-8859-1"
> X-Trace: posting.google.com 1106704770 4541 127.0.0.1 (26 Jan 2005
01:59:30 GMT)
> X-Complaints-To: groups-abuse@google.com
> NNTP-Posting-Date: Wed, 26 Jan 2005 01:59:30 +0000 (UTC)
> User-Agent: G2/0.2
> Complaints-To: groups-abuse@google.com
> Injection-Info: f14g2000cwb.googlegroups.com; posting-host=24.61.90.30;
> posting-account=IqaX-g0AAABf1vnqRnug2h2tWwNeY6Ex
> Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news.glorb.com!postnews.google.com!f14g2000cwb.go
oglegroups.com!not-for-mail
> Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.security:8846
> X-Tomcat-NG: microsoft.public.dotnet.security
>
> Hi Shawn,
>
> OK, I hope I am not being incredibly stupid here, but this is the
> disconnect I'm having in my head. I've looked at PDKDF1, which says
> that the length of the derived key is bounded by the length of the hash
> function output, which is 16 octets or 128 bits in MD5. That I can
> generate fine, but the code fragment is requesting 32 octets or 256
> bits.
>
> >From your blog, it says "PBKDF1 will only produce the number of bytes
> that the hash algorithm generates, but GetBytes will extend the result
> further, allowing you to get a large number of bytes out of your
> password."
>
> There's my question - how is GetBytes() actually producing 16 octets
> more than PDKDF1 says it should? I don't understand how GetBytes() is
> extending the result past what PBKDF1 says. It seems that it must be
> doing another hash to create the data, but how is that derived?
>
> I need to make this work exactly like the .net version as we are using
> this code to pass information between different OS'es, and if we can't
> decode and encode on the foreign systems, that is a big problem.
> Thanks for any more insight you can provide.
>
> --pete
>
>
- Next message: kishore: "Padding issue with C++ Crypto RC2 encryption"
- Previous message: savanted1_at_hotmail.com: "RE: Permissions Questions"
- In reply to: Pete: "Re: How is .net generating extra bits in MD5?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|