Endpoint Encryption

 View Only
  • 1.  PGP - Encrypted content length does not match

    Posted Nov 27, 2013 08:53 AM

    Hi everyone, 

    I'm analyzing PGP. I have encrypted one file without zipping and i have used passphrase to encrypt, so S2K algorithm will process. However, according to openPGP format, it should be in this format:

    34-byte random value (Block size + 2) + plaintext + 2 byte MDC tag + 20 byte MDC value

    For my example, plaintext's length is 35 byte. Its extension is txt, so it equals to the length of file. As a result, total amount of encrypted value should be:

    34 + 35 + 2 + 20 = 91.

    However, my encrypted file has 94 byte content. Do you have any opinion where these 3 bytes come?

    Also i have tried 3 more files to check that it has always extra 3 byte or not, however it changes for each one.

    Regards.

     



  • 2.  RE: PGP - Encrypted content length does not match

    Broadcom Employee
    Posted Dec 01, 2013 04:27 PM
    Hi Ziynet, I've never checked this, but the first thing I can think of is padding. Hope this helps, dcats


  • 3.  RE: PGP - Encrypted content length does not match

    Posted Dec 03, 2013 01:59 AM

    Thanks for your opinion Dcats.

    Then padding can be done just to plaintext, because others are written in the format with their exact values. If padding is done to plaintext, then plaintext will be 38 bytes. It doesn't make sense, because it does not equal to block size, or any meaningful value in my opinion, maybe I am missing some parts.

    If zipping is enabled, then it can be the reason; but while encrypting the file, I check that zipping is disabled.

    Also when we look at the other examples, no regular padding exist:

    • With 42 bytes plaintext, total encrypted value: 111. // It should be 98.
    • With 44 bytes plaintext, total encrypted value: 112. // It should be 100.
    • With 49 bytes plaintext, total encrypted value: 118. // It should be 105.
    Thanks for your opinions.
     
    Ziynet.