md5
Security
Index > Books > Declarative Development Guide > Reference Library > Accessor Listing > md5

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Module

urn:org:ten60:netkernel:ext:xsecurity

Definition

Active URI Base

active:md5

Format

<instr>
  <type>md5</type>
  <operand>foo.xml</operand>
  <target>this:response</target>
</instr>

Syntax

ArgumentRulesDescription
typeMandatory md5
operandOptional required the resource to be hashed
operatorOptional n/a
paramOptional n/a
targetOptional required the target resource

The md5 accessor generates an MD5 hash of the operand document. The result is a document with a root element <md5> containing the md5 hash. Here is an example:

<md5>6BBE1AF635E1CFC43006390B791D710F</md5>

Note: The md5 accessor is ideal for hashing short sensitive documents such as passwords whose source document is known to be reproducible. One must be cautious when using md5 with longer documents or when the result has undergone external serialization.

The operand document is serialized using the default serializer. For documents generated and processed internally it can be assumed that two identical documents will generate an identical hash value - it is therefore possible to use the md5 accessor to hash passwords etc. It cannot be assumed that document that has been externally serialized or in other ways processed will generate a repeatable hash value. For documents that undergo external processing the xsign accessor should be used in combination with the canonical serializer

Example

Hash a password document

This crude example shows how the md5 accessor can be used to hash a short password document. We don't recommend passwords in literals or sending the result to the response!!

<instr>
  <type>md5</type>
  <operand>
    <password>foobar</password>
  </operand>
  <target>this:response</target>
</instr>

References

xsign accessor
Apache XML Security
W3C XML Signature


(C) 2003, 1060 Research Limited
© 2003-2005, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.