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. Advertisements

  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. Advertisements

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. Wolfgang Lipp
    Replies:
    1
    Views:
    548
    Patrick TJ McPhee
    Jan 30, 2004
  2. Wolfgang Lipp
    Replies:
    0
    Views:
    630
    Wolfgang Lipp
    Jan 28, 2004
  3. Jyrki Keisala

    Elements within elements

    Jyrki Keisala, Jun 8, 2005, in forum: XML
    Replies:
    5
    Views:
    629
    William Park
    Jun 15, 2005
  4. Billy
    Replies:
    4
    Views:
    440
    Billy
    Sep 12, 2005
  5. Gerald Aichholzer
    Replies:
    2
    Views:
    3,179
    Gerald Aichholzer
    Jun 27, 2006
  6. P
    Replies:
    1
    Views:
    1,380
    Joe Kesselman
    Jul 7, 2006
  7. Adam Hartshorne
    Replies:
    2
    Views:
    486
    Nitin Motgi
    Jan 27, 2006
  8. Ultrus
    Replies:
    4
    Views:
    4,483
    Stefan Behnel
    Aug 30, 2007
Loading...