MD5 encryption examples

Discussion in 'ASP .Net Security' started by Kenneth, Nov 16, 2003.

  1. Kenneth

    Kenneth Guest

    Hi,

    I need an example on MD5 encryption.

    In a ascii textfile I have a date in string format. I need
    an example how to compute a hash value on the datestring
    and another method to compare the two with each other.

    TIA

    /Kenneth
     
    Kenneth, Nov 16, 2003
    #1
    1. Advertising

  2. Kenneth

    Alek Davis Guest

    Kenneth,

    If you want to use MD5 (or SHA-1) hashing, the easiest way would be to call
    the HashPasswordForStoringInConfigFile method, which returns a bas64-encoded
    hash value. e.g.:

    // C# code
    using System.Web.Security;
    ....
    string base64HashValue =
    FormsAuthentication.HashPasswordForStoringInConfigFile
    ("1/2/2003 7:04 PM", "md5");

    Then you can simply compare strings. If you want to keep the hashed value in
    the byte array format (or want to do something more sophisticated), check
    this example: http://www.obviex.com/samples/hash.aspx.

    Alek

    "Kenneth" <> wrote in message
    news:517201c3ac5b$2b64e5e0$...
    > Hi,
    >
    > I need an example on MD5 encryption.
    >
    > In a ascii textfile I have a date in string format. I need
    > an example how to compute a hash value on the datestring
    > and another method to compare the two with each other.
    >
    > TIA
    >
    > /Kenneth
     
    Alek Davis, Nov 17, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Afonin

    How to generate an MD5 data from the string

    Peter Afonin, Aug 20, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    499
  2. Replies:
    9
    Views:
    17,200
    John Salerno
    May 8, 2006
  3. =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=

    MD5 Encryption

    =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=, Jun 19, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    467
    =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?=
    Jun 21, 2007
  4. Replies:
    12
    Views:
    1,129
    geremy condra
    Apr 5, 2010
  5. Peter Woodsky

    create a md5 / md5 passwd with a salt

    Peter Woodsky, Nov 20, 2008, in forum: Ruby
    Replies:
    6
    Views:
    240
    Brian Candler
    Nov 21, 2008
Loading...

Share This Page