Ron,<br><br>Everything works fine in 3.9 although under OS/X there is still the problem with randomBitsFromSoundInput: but I can live with that for the momement. Any suggestions as to how to resolve the 3.8 problem?<br><br>
TIA,<br>Laurence<br><br><br><div><span class="gmail_quote">On 8/9/06, <b class="gmail_sendername">Ron Teitelbaum</b> <<a href="mailto:Ron@usmedrec.com">Ron@usmedrec.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Hi Laurence,</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">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: <a href="http://www.squeaksource.com/Cryptography" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.squeaksource.com/Cryptography</a>
we can talk about that if we get past this first part.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I tried an example (I'm in Squeak
3.9b-7051) and it appears to be working fine. Here's what I did.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">First I generated a key set.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">keys := DigitalSignatureAlgorithm
generateKeySet. </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Here is the set I got.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">#(#(11634065363621815767637298292695842594730176052067637773680192524455869230234173758150452925415401529778606418101117414536443374158088844168026367876825953
1375050214541076916535442310710144083780809418779
920725864083239042384763588357726013524708007928670717057302077747624160900068797037078329489496608106957529640438460571120920055161304057825269023490861
1115914113083931179608861092566623278044302408799)
#(11634065363621815767637298292695842594730176052067637773680192524455869230234173758150452925415401529778606418101117414536443374158088844168026367876825953
1375050214541076916535442310710144083780809418779
920725864083239042384763588357726013524708007928670717057302077747624160900068797037078329489496608106957529640438460571120920055161304057825269023490861
3955661015744856694707104263792232810044012932353264459926493154700610520372070161850876172559264752858509825362513967683454046220684740679273580024936255))</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Don't use this key set since it is
now public.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Then I signed a message: 'hello'
with the first key</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">DigitalSignatureAlgorithm sign: 'hello'
privateKey: keys first. And got a signature: </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">'[DSA digital signature
54804CFBDB9D12EA008D7C56D46FED9EB118CA0E
834CCB8563F5B863B8041D20F2C6D9C89E120DF3]'</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">So if you send the message along with the
public key (keys last) then they can verify the signature with: </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">DigitalSignatureAlgorithm verify: </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">'[DSA digital signature
54804CFBDB9D12EA008D7C56D46FED9EB118CA0E
834CCB8563F5B863B8041D20F2C6D9C89E120DF3]' isSignatureOf: 'hello' publicKey: keys
last</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">For me this came out as true. </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">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.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">I hope that helps.</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Happy coding!</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Ron
Teitelbaum</span></font><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"></span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;">Squeak Cryptography Team Leader</span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial; color: navy;"> </span></font></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0in 0in 0in 4pt;">
<div>
<div style="text-align: center;" align="center"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">
<hr align="center" size="2" width="100%">
</span></font></div>
<p><b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma; font-weight: bold;">From:</span></font></b><font face="Tahoma" size="2"><span style="font-size: 10pt; font-family: Tahoma;"> <a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
squeak-dev-bounces@lists.squeakfoundation.org</a>
[mailto:<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">squeak-dev-bounces@lists.squeakfoundation.org</a>] <b><span style="font-weight: bold;">
On Behalf Of </span></b>Laurence Rozier<br>
<b><span style="font-weight: bold;">Sent:</span></b> Wednesday, August 09, 2006
12:54 PM<br>
<b><span style="font-weight: bold;">To:</span></b> The
general-purpose Squeak developers list<br>
<b><span style="font-weight: bold;">Subject:</span></b> DigitalSignatureAlgorithm
Errors</span></font></p>
</div></div><div><span class="e" id="q_10cf431eb73f827a_1">
<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>
<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Hi,<br>
<br>
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:</span></font></p>
<div style="margin-left: 30pt;">
<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">ERROR! Signature
verification failed</span></font></p>
</div>
<p style="margin-bottom: 12pt;"><font face="Times New Roman" size="3"><span style="font-size: 12pt;">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?
<br>
<br>
TIA,<br>
<br>
Laurence<br>
<br>
</span></font></p>
</span></div><div></div>
</div>
</div>
</div><br><br><br><br></blockquote></div><br>