DigitalSignatureAlgorithm Errors

Ron Teitelbaum Ron at USMedRec.com
Wed Aug 9 18:28:44 UTC 2006


Hi Laurence,

 

I'm not sure I understand what it is you are doing.  Can you tell me what
version you are using?  I checked the error you reported on my windows XP
system but as you said it works on windows.  There is little I can do about
OS/X.  But the examples you sighted also use random typed in characters
instead.  There are others solutions such as SecureRandom available at:
www.squeaksource.com/Cryptography  we can talk about that if we get past
this first part.

 

I tried an example (I'm in Squeak 3.9b-7051) and it appears to be working
fine.  Here's what I did.

 

First I generated a key set.

 

keys := DigitalSignatureAlgorithm generateKeySet. 

 

Here is the set I got.

 

#(#(116340653636218157676372982926958425947301760520676377736801925244558692
3023417375815045292541540152977860641810111741453644337415808884416802636787
6825953 1375050214541076916535442310710144083780809418779
9207258640832390423847635883577260135247080079286707170573020777476241609000
6879703707832948949660810695752964043846057112092005516130405782526902349086
1 1115914113083931179608861092566623278044302408799)
#(11634065363621815767637298292695842594730176052067637773680192524455869230
2341737581504529254154015297786064181011174145364433741580888441680263678768
25953 1375050214541076916535442310710144083780809418779
9207258640832390423847635883577260135247080079286707170573020777476241609000
6879703707832948949660810695752964043846057112092005516130405782526902349086
1
3955661015744856694707104263792232810044012932353264459926493154700610520372
0701618508761725592647528585098253625139676834540462206847406792735800249362
55))

 

Don't use this key set since it is now public.

 

Then I signed a message: 'hello' with the first key

 

DigitalSignatureAlgorithm sign: 'hello' privateKey: keys first.  And got a
signature: 

'[DSA digital signature 54804CFBDB9D12EA008D7C56D46FED9EB118CA0E
834CCB8563F5B863B8041D20F2C6D9C89E120DF3]'

 

So if you send the message along with the public key (keys last) then they
can verify the signature with: 

 

DigitalSignatureAlgorithm verify: 

'[DSA digital signature 54804CFBDB9D12EA008D7C56D46FED9EB118CA0E
834CCB8563F5B863B8041D20F2C6D9C89E120DF3]' isSignatureOf: 'hello' publicKey:
keys last

 

For me this came out as true.  

 

Now I'm not sure what the 40 characters from Amazon are.  The number of
characters does not make someone think of key.  It could be a message that
you are supposed to sign and send back, a secret message if you will.  That
way they can verify your signature since supposedly only you and they know
the 40 byte message.  You would send back the signature and not the message,
since they know what it is already.  Still that's just a guess.  Maybe
someone else that works with Amazon can tell us.

 

I hope that helps.

 

Happy coding!

 

Ron Teitelbaum

Squeak Cryptography Team Leader

 

 

  _____  

From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of Laurence
Rozier
Sent: Wednesday, August 09, 2006 12:54 PM
To: The general-purpose Squeak developers list
Subject: DigitalSignatureAlgorithm Errors

 

Hi,

My goal is to be able sign messages for Amazon Web Services and initially I
ran into the issue of how the secret key is represented. DSA expects the key
to be part of a 4 element array, but what I have from Amazon is a single 40
character string. This is a new domain for me so I decided to first make
sure I could use/understand the implementation as it. However, class methods
such as example and timeDecode: fail with:

ERROR! Signature verification failed

I reimplemented the examples using generateKeySet instead of testKeySet but
still get the same failures. Also when I tried to use
initRandomNonInteractively to prevent having to constantly type in long
strings, Squeak crashed under OS/X(works fine under windows). Apparently
SoundService>>randomBitsFromSoundInput: is the culprit(I've reported this on
Mantis). Can anyone point me to working examples? 

TIA,

Laurence



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060809/67e66680/attachment.htm


More information about the Squeak-dev mailing list