Implementing SHA1 hashing is quiet easy on S60 2nd Edition devices.
You will need the SHA1 cpp sources from http://mikie.iki.fi/lxr/source/ContextNetwork/src/SHA1.cpp
Once you have SHA1.h and SHA1.cpp
Just write a function
TBuf8<150> iDigest; iDigest.Copy(iPassword); SHA1 * sha1 = new SHA1; sha1->Input((char*)(iDigest.Ptr()),iDigest.Size()); unsigned int message_digest_array[5]; sha1->Result(message_digest_array); TBuf<150> digest; for (int i=0;i<5;i++) { TBuf<8> h; h.Format(_L("%08x"),message_digest_array[i]); digest.Append(h); } delete sha1; iShaPass.Copy(digest);
Thats it you now have your SHA1'ed password in iShaPass.
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Cert Prob On 6230,6230i,6021 | doronguy | Mobile Java General | 17 | 2007-06-21 15:30 |
| OMA SyncML Settings | nobody0815 | General Messaging | 6 | 2008-02-12 16:17 |
| "Authorization failed" message displayed when installing jar file | capricious28 | Mobile Java General | 8 | 2008-04-03 21:34 |
| Nokia6230 does not support SMS signing?? | billlion | General Messaging | 0 | 2006-03-17 10:48 |
| Problems with installation signed midlet on nokia9300 | robja | Mobile Java Networking & Messaging & Security | 1 | 2007-01-13 13:31 |