I wonder if there's an easy way to hash?-VBForums
Results 1 to 5 of 5

Thread: I wonder if there's an easy way to hash?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Posts
    937

    I wonder if there's an easy way to hash?

    I remember reading that CryptGenRandom (which requires a handle to a Cryptographic Provider to be used) is actually just a shortcut to RtlGenRandom (which does not require any Cryptographic Provider handle). I'm wondering if there are similar shortcuts to the hashing functions. For example I would like to hash some data with SHA256, but currently I have a lot of code surrounding the actual function to hash the data. This means first setting up the hash with a call to CryptCreateHash (which requires a Cryptographic Provider handle to use), followed by CryptHashData, and then CryptGetHashParam. I'm wondering, is there any alternative to these? In particular, is there something like an undocumented (but discovered by reverse engineers) alternative to CryptCreateHash, one which doesn't require a Cryptographic Provider handle?

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,774

    Re: I wonder if there's an easy way to hash?

    You can find a class for SHA256 in the attachment of this thread: http://www.vbforums.com/showthread.p...HA1-and-SHA256

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Posts
    937

    Re: I wonder if there's an easy way to hash?

    Quote Originally Posted by CVMichael View Post
    You can find a class for SHA256 in the attachment of this thread: http://www.vbforums.com/showthread.p...HA1-and-SHA256
    I'm looking for a hidden Windows API function (possibly one which can only be accessed by ordinal) which allows the calculation of an SHA256 hash.

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    5,082

    Re: I wonder if there's an easy way to hash?

    If for some reason you do not want someone see the .net function you are using to hash then you can hash in a C++ dll and import the dll, you'll be somewhat like calling a windows API.
    Or you can get a free C++ library and import that. I found this one with a quick search: https://www.cryptopp.com/
    Slow as hell.

  5. #5
    Hyperactive Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    427

    Re: I wonder if there's an easy way to hash?

    Quote Originally Posted by Ben321 View Post
    I'm looking for a hidden Windows API function (possibly one which can only be accessed by ordinal) which allows the calculation of an SHA256 hash.
    If an unofficial exported api is found in a Microsoft .dll then I would advise against its use as it is almost certainly not a Microsoft supported function and may change/be deleted at any-time in the future and hence cannot be relied upon.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.5.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.