Home All Groups Group Topic Archive Search About

Keyed hash vs Digital signature ????

Author
21 Jul 2006 8:45 AM
serge calderara
Dear all,

I am a bit confuse with hashing and Digitaly sign data.
I have understand that hashing a file with a keyed Hash class, you are
protecting hash value to be modified becasue it is regenerated with a secret
key exanged between the sender and receiver. The receiver will then trust the
sender about the source of the information

Now I have check the Digital Signature feature which is doing similar thing
except I understand that it add one more level which is the signature which
wrapp the encrypted data and the hash.
I have read that signature prove also that data has been generated and issue
by a trust sender... Similar as a keyed hash then

What is the benfits then to sign if Keye hasing get same result ?

thnaks for help
regards
serge

Author
21 Jul 2006 9:25 AM
Dominick Baier
The underlying key types and crypto technologies are different.

HMACS are typically used with symmetric keys (typically a 1-1 relationship
between sender and receiver using a shared key)
DSIGs are typcially used with asymmetric keys (a 1-n relationship, one can
form a DSIG, everybody with access to the pub key can verify it)

dominick
www.leastprivilege.com

Show quoteHide quote
> Dear all,
>
> I am a bit confuse with hashing and Digitaly sign data.
> I have understand that hashing a file with a keyed Hash class, you are
> protecting hash value to be modified becasue it is regenerated with a
> secret
> key exanged between the sender and receiver. The receiver will then
> trust the
> sender about the source of the information
> Now I have check the Digital Signature feature which is doing similar
> thing
> except I understand that it add one more level which is the signature
> which
> wrapp the encrypted data and the hash.
> I have read that signature prove also that data has been generated and
> issue
> by a trust sender... Similar as a keyed hash then
> What is the benfits then to sign if Keye hasing get same result ?
>
> thnaks for help
> regards
> serge
Author
21 Jul 2006 10:01 AM
serge calderara
thnaks for the clarification

Show quoteHide quote
"Dominick Baier" wrote:

> The underlying key types and crypto technologies are different.
>
> HMACS are typically used with symmetric keys (typically a 1-1 relationship
> between sender and receiver using a shared key)
> DSIGs are typcially used with asymmetric keys (a 1-n relationship, one can
> form a DSIG, everybody with access to the pub key can verify it)
>
> dominick
> www.leastprivilege.com
>
> > Dear all,
> >
> > I am a bit confuse with hashing and Digitaly sign data.
> > I have understand that hashing a file with a keyed Hash class, you are
> > protecting hash value to be modified becasue it is regenerated with a
> > secret
> > key exanged between the sender and receiver. The receiver will then
> > trust the
> > sender about the source of the information
> > Now I have check the Digital Signature feature which is doing similar
> > thing
> > except I understand that it add one more level which is the signature
> > which
> > wrapp the encrypted data and the hash.
> > I have read that signature prove also that data has been generated and
> > issue
> > by a trust sender... Similar as a keyed hash then
> > What is the benfits then to sign if Keye hasing get same result ?
> >
> > thnaks for help
> > regards
> > serge
>
>
>
Author
21 Jul 2006 10:20 AM
serge calderara
In which form in that case everybody can access the public key then ?
If you wnat that everybody can verify a file signature, everybody should
know how it has been build no ?

For example if I signe a file with that way :

Dim signer as RSACryptoServiceProvider= new RSACryptoServiceProvider
signer.SignData(Data, new SHA1CryptoServiceProvider)

Then for verify the signature I need to use
signer.VerfyData(Data, new SHA1CryptoServiceProvider, signature)

or can it be so that as long as you provide a signature and a file, any
application have enough information to verify it ?

thnaks fro help
Show quoteHide quote
"Dominick Baier" wrote:

> The underlying key types and crypto technologies are different.
>
> HMACS are typically used with symmetric keys (typically a 1-1 relationship
> between sender and receiver using a shared key)
> DSIGs are typcially used with asymmetric keys (a 1-n relationship, one can
> form a DSIG, everybody with access to the pub key can verify it)
>
> dominick
> www.leastprivilege.com
>
> > Dear all,
> >
> > I am a bit confuse with hashing and Digitaly sign data.
> > I have understand that hashing a file with a keyed Hash class, you are
> > protecting hash value to be modified becasue it is regenerated with a
> > secret
> > key exanged between the sender and receiver. The receiver will then
> > trust the
> > sender about the source of the information
> > Now I have check the Digital Signature feature which is doing similar
> > thing
> > except I understand that it add one more level which is the signature
> > which
> > wrapp the encrypted data and the hash.
> > I have read that signature prove also that data has been generated and
> > issue
> > by a trust sender... Similar as a keyed hash then
> > What is the benfits then to sign if Keye hasing get same result ?
> >
> > thnaks for help
> > regards
> > serge
>
>
>
Author
21 Jul 2006 10:43 AM
Dominick Baier
For DSIGs you usually use certificates. They add authentication to public
keys. Otherwise it is not possible to verify that you are really using the
right public key (besides you received the pub key using an out of band method
like on a CD, verbal or a fax etc).

Certs can be made available in various ways - e.g. you can embed them in
the signature, make them downloadable and so forth.

Have a look at the System.Security.Cryptography.X509Certificates and Pkcs
namespace - here's also a sample app that does signing/encryption using certs:
http://www.leastprivilege.com/CrypterPKRTMVersion.aspx


dominick

Show quoteHide quote
> In which form in that case everybody can access the public key then ?
> If you wnat that everybody can verify a file signature, everybody
> should
> know how it has been build no ?
> For example if I signe a file with that way :
>
> Dim signer as RSACryptoServiceProvider= new RSACryptoServiceProvider
> signer.SignData(Data, new SHA1CryptoServiceProvider)
>
> Then for verify the signature I need to use
> signer.VerfyData(Data, new SHA1CryptoServiceProvider, signature)
> or can it be so that as long as you provide a signature and a file,
> any application have enough information to verify it ?
>
> thnaks fro help
> "Dominick Baier" wrote:
>> The underlying key types and crypto technologies are different.
>>
>> HMACS are typically used with symmetric keys (typically a 1-1
>> relationship
>> between sender and receiver using a shared key)
>> DSIGs are typcially used with asymmetric keys (a 1-n relationship,
>> one can
>> form a DSIG, everybody with access to the pub key can verify it)
>> dominick
>> www.leastprivilege.com
>>> Dear all,
>>>
>>> I am a bit confuse with hashing and Digitaly sign data.
>>> I have understand that hashing a file with a keyed Hash class, you
>>> are
>>> protecting hash value to be modified becasue it is regenerated with
>>> a
>>> secret
>>> key exanged between the sender and receiver. The receiver will then
>>> trust the
>>> sender about the source of the information
>>> Now I have check the Digital Signature feature which is doing
>>> similar
>>> thing
>>> except I understand that it add one more level which is the
>>> signature
>>> which
>>> wrapp the encrypted data and the hash.
>>> I have read that signature prove also that data has been generated
>>> and
>>> issue
>>> by a trust sender... Similar as a keyed hash then
>>> What is the benfits then to sign if Keye hasing get same result ?
>>> thnaks for help
>>> regards
>>> serge
Author
21 Jul 2006 11:24 AM
serge calderara
What I have heard and read about certificate is that it require maintenance,
might need also PKI...

How is it then in real life, does company requring signing are all directed
to Certificated and CA like Verisign ?

Show quoteHide quote
"Dominick Baier" wrote:

> For DSIGs you usually use certificates. They add authentication to public
> keys. Otherwise it is not possible to verify that you are really using the
> right public key (besides you received the pub key using an out of band method
> like on a CD, verbal or a fax etc).
>
> Certs can be made available in various ways - e.g. you can embed them in
> the signature, make them downloadable and so forth.
>
> Have a look at the System.Security.Cryptography.X509Certificates and Pkcs
> namespace - here's also a sample app that does signing/encryption using certs:
> http://www.leastprivilege.com/CrypterPKRTMVersion.aspx
>
>
> dominick
>
> > In which form in that case everybody can access the public key then ?
> > If you wnat that everybody can verify a file signature, everybody
> > should
> > know how it has been build no ?
> > For example if I signe a file with that way :
> >
> > Dim signer as RSACryptoServiceProvider= new RSACryptoServiceProvider
> > signer.SignData(Data, new SHA1CryptoServiceProvider)
> >
> > Then for verify the signature I need to use
> > signer.VerfyData(Data, new SHA1CryptoServiceProvider, signature)
> > or can it be so that as long as you provide a signature and a file,
> > any application have enough information to verify it ?
> >
> > thnaks fro help
> > "Dominick Baier" wrote:
> >> The underlying key types and crypto technologies are different.
> >>
> >> HMACS are typically used with symmetric keys (typically a 1-1
> >> relationship
> >> between sender and receiver using a shared key)
> >> DSIGs are typcially used with asymmetric keys (a 1-n relationship,
> >> one can
> >> form a DSIG, everybody with access to the pub key can verify it)
> >> dominick
> >> www.leastprivilege.com
> >>> Dear all,
> >>>
> >>> I am a bit confuse with hashing and Digitaly sign data.
> >>> I have understand that hashing a file with a keyed Hash class, you
> >>> are
> >>> protecting hash value to be modified becasue it is regenerated with
> >>> a
> >>> secret
> >>> key exanged between the sender and receiver. The receiver will then
> >>> trust the
> >>> sender about the source of the information
> >>> Now I have check the Digital Signature feature which is doing
> >>> similar
> >>> thing
> >>> except I understand that it add one more level which is the
> >>> signature
> >>> which
> >>> wrapp the encrypted data and the hash.
> >>> I have read that signature prove also that data has been generated
> >>> and
> >>> issue
> >>> by a trust sender... Similar as a keyed hash then
> >>> What is the benfits then to sign if Keye hasing get same result ?
> >>> thnaks for help
> >>> regards
> >>> serge
>
>
>
Author
21 Jul 2006 11:46 AM
Dominick Baier
You can also have internal CA - Windows Server 2003 e.g. includes one.

dominick

Show quoteHide quote
> What I have heard and read about certificate is that it require
> maintenance, might need also PKI...
>
> How is it then in real life, does company requring signing are all
> directed to Certificated and CA like Verisign ?
>
> "Dominick Baier" wrote:
>
>> For DSIGs you usually use certificates. They add authentication to
>> public keys. Otherwise it is not possible to verify that you are
>> really using the right public key (besides you received the pub key
>> using an out of band method like on a CD, verbal or a fax etc).
>>
>> Certs can be made available in various ways - e.g. you can embed them
>> in the signature, make them downloadable and so forth.
>>
>> Have a look at the System.Security.Cryptography.X509Certificates and
>> Pkcs namespace - here's also a sample app that does
>> signing/encryption using certs:
>> http://www.leastprivilege.com/CrypterPKRTMVersion.aspx
>>
>> dominick
>>
>>> In which form in that case everybody can access the public key then
>>> ?
>>> If you wnat that everybody can verify a file signature, everybody
>>> should
>>> know how it has been build no ?
>>> For example if I signe a file with that way :
>>> Dim signer as RSACryptoServiceProvider= new RSACryptoServiceProvider
>>> signer.SignData(Data, new SHA1CryptoServiceProvider)
>>>
>>> Then for verify the signature I need to use
>>> signer.VerfyData(Data, new SHA1CryptoServiceProvider, signature)
>>> or can it be so that as long as you provide a signature and a file,
>>> any application have enough information to verify it ?
>>> thnaks fro help
>>> "Dominick Baier" wrote:
>>>> The underlying key types and crypto technologies are different.
>>>>
>>>> HMACS are typically used with symmetric keys (typically a 1-1
>>>> relationship
>>>> between sender and receiver using a shared key)
>>>> DSIGs are typcially used with asymmetric keys (a 1-n relationship,
>>>> one can
>>>> form a DSIG, everybody with access to the pub key can verify it)
>>>> dominick
>>>> www.leastprivilege.com
>>>>> Dear all,
>>>>>
>>>>> I am a bit confuse with hashing and Digitaly sign data.
>>>>> I have understand that hashing a file with a keyed Hash class, you
>>>>> are
>>>>> protecting hash value to be modified becasue it is regenerated
>>>>> with
>>>>> a
>>>>> secret
>>>>> key exanged between the sender and receiver. The receiver will
>>>>> then
>>>>> trust the
>>>>> sender about the source of the information
>>>>> Now I have check the Digital Signature feature which is doing
>>>>> similar
>>>>> thing
>>>>> except I understand that it add one more level which is the
>>>>> signature
>>>>> which
>>>>> wrapp the encrypted data and the hash.
>>>>> I have read that signature prove also that data has been generated
>>>>> and
>>>>> issue
>>>>> by a trust sender... Similar as a keyed hash then
>>>>> What is the benfits then to sign if Keye hasing get same result ?
>>>>> thnaks for help
>>>>> regards
>>>>> serge