×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Encryption using MD5

    Hi,

    Please let me know how do we encrypt files using MD5 encryption in symbian and also to check for tamper proof files.

    Let me know if there r any code samples for the same.

    Regards,
    Neetha.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Encryption using MD5

    Searching for md5 in the SDK Help reveals that a class CMD5 exists. Personally I would try its NewL and Hash methods.

  3. #3
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Encryption using MD5

    MD5 provides verification services, not encryption.
    MD5 is a tamper evident, not tamperproof solution.

    You will probably have to read in the whole file a block at a time and run it through the CMD5 class to generate an md5 hash of the file contents.

    http://www.symbian.com/developer/tec...ash.guide.html
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  4. #4
    Registered User
    Join Date
    Mar 2008
    Posts
    30

    Re: Encryption using MD5

    CMD5* MD5 = CMD5::NewL();
    CleanupStack::PushL(MD5);
    TPtrC8 HashSigned(MD5->Hash(aFileName));
    CleanupStack::PopAndDestroy(MD5);
    return HashSigned;

    Iam using the above code snippet to hash the string passed, but when debugging it says HashSigened in unidentified expression its not returning anything, please let me know ur suggestions on the same.

    Regards,
    Neetha!

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,734

    Re: Encryption using MD5

    TPtr... types are descriptor pointers, so the TPtrC8 provided by CMD5::Hash probably points to some internal memeber of the CMD5 object - which you actually destroy. Since destroying the CMD5 is a good idea (you do not need it after calculating the checksum), you should copy the checksum before deleting the object, for example into a HBufC8:
    Code:
    CMD5* MD5 = CMD5::NewL();
    CleanupStack::PushL(MD5);
    HBufC8 *HashSigned=(MD5->Hash(aFileName)).AllocL();
    CleanupStack::PopAndDestroy(MD5);
    return HashSigned;

Similar Threads

  1. Need some help regarding SyncML-DM Authentication MD5
    By Yarra Srinivasa Rao in forum OMA DM/DS/CP
    Replies: 0
    Last Post: 2006-11-24, 11:10
  2. create MD5 for a file...
    By GeKI in forum Symbian
    Replies: 3
    Last Post: 2006-06-02, 11:15
  3. MD5 Encryption
    By visionSITPL in forum Symbian
    Replies: 9
    Last Post: 2006-04-02, 10:09
  4. Encryption Algorithm in Symbian
    By er_gps212 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2005-10-18, 11:43
  5. MD5 encryption...
    By julie_777 in forum Symbian
    Replies: 3
    Last Post: 2005-02-22, 18:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×