<div>Hi Thorsten,</div><div><br></div><div>Thanks for the response.</div><div><br></div><div>It wasn't for Home Work :-)</div><div><br></div><div>I went through some examples and I understand that to achieve my goal i have to do two things.</div>
<div><br></div><div>1. Compute the Hash Value of my Data.</div><div>2. Sign the computed Hash Value with my Private Key.</div><div><br></div><div>To achieve 1 above, i believe that the following code will help me (assuming that data is ABC).</div>
<div><br></div><div>from Crypto.Hash import SHA</div><div>m = SHA.new()</div><div>m.update('ABC')</div><div><br></div><div>What I am not sure is if I should use </div><div><br></div><div>m.digest()</div><div>or</div>
<div>m.hexdigest() as the computed hash value.</div><div><br></div><div>Following this, how can i use Crypto again to Sign the computed Hash Value using the Private Key?</div><div><br></div><div>Appreciate your help on this.</div>
<div><br></div><div>Regards,</div><div>Anurag</div><br><div class="gmail_quote">On Wed, Dec 29, 2010 at 1:32 AM, Thorsten Behrens <span dir="ltr"><<a href="mailto:sbehrens@gmx.li">sbehrens@gmx.li</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 12/28/2010 2:44 PM, Anurag Chourasia wrote:<br>
><br>
> I have a Private key and Public Key which comes in an XML in the<br>
> following form.<br>
</div>[..]<br>
<div class="im">> Could you please let me know how I could use Crypto to meet this<br>
> requirement. Appreciate if you could help me with a simple code snippet.<br>
><br>
<br>
</div>Is this homework? :)<br>
<br>
If so, I'd give you a hint: Take a good look at the test routines in<br>
Crypto/Selftest, they are examples of how to use the library.<br>
<br>
Thorsten<br>
<br>
_______________________________________________<br>
pycrypto mailing list<br>
<a href="mailto:pycrypto@lists.dlitz.net">pycrypto@lists.dlitz.net</a><br>
<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto" target="_blank">http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto</a><br>
</blockquote></div><br>