Community: Wiki

你在这里: You Are Here: Olet tässä: Vous êtes ici: Sie befinden sich hier: Tu sei qui: 現在のページ: Você está aqui: Вы здесь: Usted está aquí:
This page was last modified 14:58, 8 December 2007.

SHA1

From Forum Nokia Wiki

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.

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditFurlTechnocratiMagnoliaTwitter  Share this page Share this page Invite a friend Invite a friend
E-mail Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us Regional websites: Chinese Japanese © 2008 Nokia 
RDF Facets: qfnZtypeQUqfnTypeZCommunityContentQ qfnZtypeQUqfnTypeZWebpageQ qfnZtypeQUqfnTypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX