W3C home > Mailing lists > Public > w3c-ietf-xmldsig@w3.org > January to March 2004

RE: how to calculate DigestValue

From: John Boyer <JBoyer@PureEdge.com>
Date: Tue, 13 Jan 2004 17:37:26 -0800
Message-ID: <7874BFCCD289A645B5CE3935769F0B526845AE@tigger.pureedge.com>
To: "Thomas Braun" <ThoBr@t-online.de>, <w3c-ietf-xmldsig@w3.org>

Hi Thomas,

A sha1 hash is 160 bits of binary data, or 20 bytes.  base64 takes 6-bit chunks of data and makes them into 8 bit chunks.  There's a little magic done at the end of the data, but 28 bytes is the correct size.

My guess is that you are converting 20 unicode characters with base64, not 20 bytes.

John Boyer, Ph.D.
Senior Product Architect and Research Scientist
PureEdge Solutions Inc.

-----Original Message-----
From: Thomas Braun [mailto:ThoBr@t-online.de]
Sent: Tuesday, January 13, 2004 4:58 PM
To: w3c-ietf-xmldsig@w3.org
Subject: how to calculate DigestValue


I'm trying to familiarize myself with xml-signatures.
When I try to reproduce the DigestValue of some examples I found, I never get a satisfying result. 
If I have understood the procedure of getting the digestvalue well, the things to do are:
- generate sha1-hash of the referenced object
- transform hash to base64 

All DigestValue-examples I've seen yet, have a base64 code-length of 28 chars.
But when I transform a sha1-hash into base64, the result has always a length of 56 chars. 

So I guess I'm lapsing something fundamental...

Thanks a lot,

Received on Tuesday, 13 January 2004 20:37:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:21:39 UTC