Generating hash value

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Generating hash value

    Following Microsoft recommendations, I'd like to store a one-way passport
    hash of a user's password. .NET provides method
    FormsAuthentication.HashPasswordForStoringinConfig File (...) to generate a
    hash value with either SHA1 or MD5 algorithm. My problem is that the
    password is to be generated on a workstation with no .NET installed. How can
    I generate a hash value without .NET in the same way as
    HashPasswordForStoringinConfigFile does? Is there any sequence of Windows
    Crypto API calls with the same effect? An external stored procedure on the
    server side?

    Eliyahu


    Eliyahu Goldin Guest

  2. Similar Questions and Discussions

    1. Generating PDF from XLS
      Hi, I am trying to generate PDF document from an XLS using Distiller API. In Excel, I have set the page size as A4. However, the generated PDF is...
    2. hash of hash of array slices
      This works Foreach ( @{$hash{$key1}{$key2}} ) This does note Foreach ( @{($hash{$key1}{$key2})} ) This gives me this error .... Can't...
    3. Sort a hash based on values in the hash stored as arrays of hashes
      Hmm. I'm not quite sure if I got the subject right, but I'll try to explain. :-) I've got a hash of elements stored like this: $VAR1 = {...
    4. Another reference question (hash of hash references)
      beginners, I am trying to build a hash of hash references. My problem is that I need to be able to add a key/value pair to the internal hashes......
    5. SAR sa2 not generating reports
      My system activity reports are no longer being generated. Here's the setup: cron says : 0,15,30,45 * * * * /usr/lib/sa/sa1 So every 15...
  3. #2

    Default Re: Generating hash value

    Yes, CryptoAPI supports calculating hashes using functions:
    CryptCreateHash
    CryptHashData
    CryptGetHashParam (with dwParam = HP_HASHVAL to get actual hash buffer)
    Start here:
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/data_hashes.asp[/url]

    The byte order in the capi buffer returned is identical to data in .NET
    HashPasswordForStoringinConfigFile string.
    You only need to convert the byte buffer into an ordered hex-string to match the .NET hash string.

    - Michel Gallant
    MVP Security


    "Eliyahu Goldin" <removemeegoldin@monarchmed.com> wrote in message
    news:Orw0CVVzDHA.2932@TK2MSFTNGP09.phx.gbl...
    > Following Microsoft recommendations, I'd like to store a one-way passport
    > hash of a user's password. .NET provides method
    > FormsAuthentication.HashPasswordForStoringinConfig File (...) to generate a
    > hash value with either SHA1 or MD5 algorithm. My problem is that the
    > password is to be generated on a workstation with no .NET installed. How can
    > I generate a hash value without .NET in the same way as
    > HashPasswordForStoringinConfigFile does? Is there any sequence of Windows
    > Crypto API calls with the same effect? An external stored procedure on the
    > server side?
    >
    > Eliyahu
    >
    >

    Michel Gallant Guest

  4. #3

    Default Re: Generating hash value

    > Crypto API calls with the same effect? An external stored procedure on the
    > server side?
    you can use XP_CRYPT ([url]www.activecrypt.com[/url]). Free version supports SHA1, MD5
    and DES hashes without limitations.


    Andy Guest

  5. #4

    Default Re: Generating hash value

    Thanks Michel and Andy,

    Your answers are exactly what I need.

    Eliyahu



    Eliyahu Goldin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139