×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    2

    How to encrypt the password by cbc mode with cryptography libraries

    I'm getting panic crypto.dll 1

    my code:
    Code:
    #include <cryptosymmetric.h>
    Code:
    HBufC8* dataHbuf = NULL;
    dataHbuf = HBufC8::NewL(48);
    TPtr8 dataPtr = dataHbuf->Des();
    _LIT(KData, "The quick brown fox jumps over the lazy dog.....");
    dataPtr.Copy( KData );
    CBCEncryption( dataPtr );
    Code:
    void CCBCTest::CBCEncryption( TPtr8& aDataPtr )
    	{
    	TBuf8<16> IV(_L8("abcdefghijklmnop"));
    	TBuf8<16> Key( _L8("1234567890123456") );
    		
    	CAESEncryptor* aesEncryptor = CAESEncryptor::NewL(Key);
    	CModeCBCEncryptor* cbcEncryptor = CModeCBCEncryptor::NewLC(aesEncryptor, IV);
    	
    	for(TInt i = 0; i<3; i++)
    		{
    		TPtr8 tempDataptr = aDataPtr.MidTPtr(16*i,16);
    		cbcEncryptor->Transform(tempDataptr);	// panic crypto.dll 1
    		cbcEncryptor->SetIV(tempDataptr);
    		}
    	
    	CleanupStack::PopAndDestroy();
    	}
    the mmp file's code:
    Code:
    LIBRARY crypto.lib
    LIBRARY cryptography.lib
    LIBRARY pbe.lib
    What should I do?
    Please hlep me~
    Last edited by zhengguoli; 2013-05-06 at 05:18.

  2. #2
    Registered User
    Join Date
    Jan 2005
    Location
    Italy
    Posts
    639

    Re: How to encrypt the password by cbc mode with cryptography libraries

    Hello,
    crypto lib is fading memories for me now.... anyway, are you sure that KData is a multiple of 16 bytes ? usually that panic is raised when size of Tranform() argument is not a multiple of block data...
    please refer to these threads to find a solution to your problem:
    http://www.developer.nokia.com/Commu...-System-error-!!
    http://www.developer.nokia.com/Commu...958#post721958

    hope it helps
    regards
    pg

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    2

    Re: How to encrypt the password by cbc mode with cryptography libraries

    Quote Originally Posted by pavarang View Post
    Hello,
    crypto lib is fading memories for me now.... anyway, are you sure that KData is a multiple of 16 bytes ? usually that panic is raised when size of Tranform() argument is not a multiple of block data...
    please refer to these threads to find a solution to your problem:
    http://www.developer.nokia.com/Commu...-System-error-!!
    http://www.developer.nokia.com/Commu...958#post721958

    hope it helps
    regards
    pg
    Thanks for your help!
    I'll look at the reference materials from you provide.
    Thanks again!

Similar Threads

  1. How to encrypt and decrypt password
    By Md. Kayesh in forum Symbian
    Replies: 3
    Last Post: 2011-10-27, 16:21
  2. Replies: 1
    Last Post: 2011-01-19, 11:06
  3. Cryptography Libraries
    By bart12 in forum Symbian
    Replies: 3
    Last Post: 2010-02-03, 14:49
  4. encrypt & decrypt the name and password in series 60
    By pravesh99_sw in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-02-02, 16:32

Posting Permissions

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