Hashing Elements

Discussion in 'XML' started by Mike King, Jul 30, 2004.

  1. Mike King

    Mike King Guest

    Is there a way to create a hash of an element with all of its descendants?
    I want to uniquely identify an element within a XML document not by its
    position but by its content (not concatenated string values). Something
    like a hashed Infoset of an element in a Base64 format.

    The reason why I want to do this is because different users of the document
    apply different values to the elements in the document.

    Right now, I'm running the XML file through a MD5 algorithm which produces a
    hash of the file. Then, I save that hash to a file with the values the user
    applys to that document, but this approach doesn't allow for the elements to
    change their position within the document.

    I know XML Digital Signatures might be what I want, but I don't know where
    to begin. I'm currently using MSXML4 and .NET for my XML work. Is where
    any hope for me?
    Mike King, Jul 30, 2004
    #1
    1. Advertising

  2. Mike King

    FLEB Guest

    Regarding this well-known quote, often attributed to Mike King's famous
    "Fri, 30 Jul 2004 13:36:10 -0400" speech:

    > Is there a way to create a hash of an element with all of its descendants?
    > I want to uniquely identify an element within a XML document not by its
    > position but by its content (not concatenated string values). Something
    > like a hashed Infoset of an element in a Base64 format.
    >
    > The reason why I want to do this is because different users of the document
    > apply different values to the elements in the document.
    >
    > Right now, I'm running the XML file through a MD5 algorithm which produces a
    > hash of the file. Then, I save that hash to a file with the values the user
    > applys to that document, but this approach doesn't allow for the elements to
    > change their position within the document.
    >
    > I know XML Digital Signatures might be what I want, but I don't know where
    > to begin. I'm currently using MSXML4 and .NET for my XML work. Is where
    > any hope for me?


    You could just pull out indicative portions of the data, sorted into a
    particular order, either via a processing script, or with an XSLT
    transform, then MD5 that. If things might change order, just force them
    into order with a sort.

    --
    -- Rudy Fleminger
    -- -down-to.us
    (put "Hey!" in the Subject line for priority processing!)
    -- http://www.pixelsaredead.com
    FLEB, Aug 17, 2004
    #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. Guadala Harry
    Replies:
    4
    Views:
    373
    Steve C. Orr [MVP, MCSD]
    Sep 12, 2004
  2. =?Utf-8?B?QnJpYW4=?=

    Password Hashing and User Authentication

    =?Utf-8?B?QnJpYW4=?=, Jun 6, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    375
    =?Utf-8?B?QnJpYW4=?=
    Jun 6, 2005
  3. Showjumper

    Hashing Passwords

    Showjumper, Dec 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    374
    Showjumper
    Dec 22, 2005
  4. TT \(Tom Tempelaere\)

    Hashing

    TT \(Tom Tempelaere\), Feb 5, 2004, in forum: Java
    Replies:
    6
    Views:
    712
    TT \(Tom Tempelaere\)
    Feb 8, 2004
  5. Password hashing

    , Apr 15, 2004, in forum: Java
    Replies:
    3
    Views:
    2,354
    Roedy Green
    Apr 15, 2004
Loading...

Share This Page