Results 1 to 4 of 4
  1. #1
    nanaji is offline Member
    Join Date
    May 2008
    Posts
    31
    Rep Power
    0

    Default padding informaiton for PKCS#5

    Hi

    How to know ,how many padding bytes added to encrypt the block. I believe that pkcs5# add the padding bytes to encrypt.
    I just want to check , is there methods to check how many padding bytes added ?


    Regards
    Nanaji
    Last edited by nanaji; 07-30-2008 at 11:22 AM.

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default padding is padding

    Quote Originally Posted by nanaji View Post
    How to know ,how many padding bytes added to encrypt the block. I believe that pkcs5# add the padding bytes to encrypt.
    I read up on it not too long ago, the cipher always gets padded out to a predictable number. How much depends on the cipher. You have to read up on each cipher, but if the padding comes in as zero then the full padding amount is tacked on. That way the receiver can always expect at least one padding byte, which is defined for each cipher.

    I found Jason Weiss book to be telling.

    Quote Originally Posted by nanaji View Post
    I just want to check , is there methods to check how many padding bytes added ?
    Read the docs for the cipher class you are using .
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    nanaji is offline Member
    Join Date
    May 2008
    Posts
    31
    Rep Power
    0

    Default cipher info

    Thanks Nicholas. appreciate.

  4. #4
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    There is an RFC that specifies it, RFC 3852 section 6.3
    RFC 3852 - Cryptographic Message Syntax (CMS)

    This is also sometimes refered to as PKCS7

    If you want real overkill, google for OAEP

Posting Permissions

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