You aren’t going to be able to call CryptoAPI from kernel mode (unless
there is some undocumented kernel mode interface that I don’t know
about). SHA1 is really easy to implement in kernel mode and the link
that Jamey posted is probably your best bet.
If you are concerned about your implementation of the algorithm, or
indeed even if you are not concerned, you should run your algorithm
against the NIST test vectors (http://csrc.nist.gov/cryptval/shs.html)
to make sure your implementation is correct.
Ben Curley
DESlock+ Lead Developer
Data Encryption Systems Ltd.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dana Epp
Sent: 04 October 2004 08:10
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Implimenting digest hashing in the Kernel
Thanks for the info Jamey,
I am aware that there is a lot of open source code out there. I was more
looking for work that may be using Microsoft’s CryptoAPI and the stuff
in wincrypt.h for the kernel to get the work done.
I am a firm believer that writing your own crypto is a bad thing. Even
trying to implement your own version of an existing algorithm should be
frowned up; many people smarter than me have tried and failed. And thats
why most cipherpunks and mathematicians have very little hair… they
already had to walk that path 
In a pinch I can port the openssl code that handles SHA1… thats not a
real concern. What I am hoping though is that there is a more
“Microsoft” way in accomplishing that.
Anyone know of such a method?
Jamey Kirby wrote:
Google turned this up. It should be no problems to port to NT kernel
mode. I also suspect a good book or text on SHA-1 should be sufficient
to write your own.
http://www.thefreecountry.com/sourcecode/encryption.shtml
Jamey
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dana Epp
Sent: Sunday, October 03, 2004 9:07 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Implimenting digest hashing in the Kernel
Hey guys,
I was wondering if anyone could point me to some documentation and/or
sample code that may have implemented SHA1 or MD5 for creation of a
hash of a file within a fsd. I would be interested to know about tips,
tricks and traps in doing so, without having to go to usermode to do
the dirty work.
Anyone know of such a thing?
–
Regards,
Dana Epp
[Blog: http://silverstr.ufies.org/blog/]
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@des.co.uk
To unsubscribe send a blank email to xxxxx@lists.osr.com