×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    6

    Missing bits in encrypted text

    Hi,

    I am using the RSA encryptor from the cryptography library. I am using a 1024 bits public key for encryption.


    TBuf8<16> aesKeys;
    aesKeys.Copy(_L8("1234567890123456"));
    TBuf8<128> outputs;
    for(TInt j = 0; j < 600; j++)
    {

    CRSAPKCS1v15Encryptor* iRSAEncryptors = CRSAPKCS1v15Encryptor::NewLC(*iPublicKey);
    iRSAEncryptors->EncryptL(aesKeys, outputs);
    if(outputs.Length()!=128) //128 bytes = 1024 bits
    {
    ......
    }
    }


    I realise that on several occasions, the length of the encrypted text is not 1024 bits but 1020 bits! I have tried using TBuf and HBufC to store the encrypted text but the bug still occurs.

    Please advise. Thanks.

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

    Re: Missing bits in encrypted text

    1020 bits would mean that your output ends with a half byte... What do you get exactly?

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    6

    Re: Missing bits in encrypted text

    Sorry made a mistake... i got 1016 bits..which is equivalent to 127 bytes...

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    6

    Re: Missing bits in encrypted text

    Has anyone out here been using the cryptography libraries? I just discovered another bug with the RInteger

    RInteger iRandom = RInteger::NewRandomL(128); //generate 128 bits (16 bytes)

    The operation above sometimes only generate 15 bytes! Has anyone experienced it before?

Similar Threads

  1. how get the text from rich text editor in the dialog
    By manjunaths in forum Symbian User Interface
    Replies: 4
    Last Post: 2010-12-01, 13:14
  2. Text color in Grid on S60 v3.1
    By ppiggy in forum Symbian
    Replies: 2
    Last Post: 2010-01-21, 03:24
  3. Displaying the contents of a text file
    By dennis_munsie in forum Symbian
    Replies: 1
    Last Post: 2009-03-06, 06:08
  4. Enumerated text setting item
    By WaelA in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-11-17, 06:05
  5. Characters missing in CEikLabel text
    By cl_max1mum in forum Symbian User Interface
    Replies: 1
    Last Post: 2001-12-05, 20: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
  •  
×