Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4309467

CBC mode should be used in Nopadding mode no matter what is length of input text

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P5 P5
    • None
    • unknown
    • security-libs

      CBC & ECB mode are running OK with Nopadding mode if the length of input text is the mutiple of 8, such as 80 bytes, 800 bytes and so on.
      But they won't work with Nopadding mode if the length of input text is NOT the mutiple of 8, such as 801 bytes, 802 bytes and so on.

      I thought that
      CBC & ECB mode should be allowed to use with Nopadding mode no matter what is length of input text.

      The reasons are:
      1.file encryption and decryption.
        Sometime, a plaintext file has to be encrypted and then replaced in the exact
        same memory location. In this case, data expanding is not desired.
        So, Nopadding mode should be supported with any length of input text.
      2.Database encryption and decryption.
        Normally, data expanding is not desired in database management system.
        Because database schema won't be changed easily, especially data structre
        can not be changed from time to time (that means the length of data field is
        fixed).
        For example, the length of DOB(Date of Birth) field could be ten
        bytes(MM/DD/YYYY). for the length of SSN field could be nine bytes. If the
        ciphertext is longer than plain text, it can not be save back to the same
        field.
        So, Nopadding mode should be supported with any length of input text.
      3. CBC mode is gernerally best for encrypting files. .... If your application
         is software-based, CBC is almost always the best choice.
         see Applied Cryptography, Second Edition, Bruce Schneier. Page 208, last
         paragraph
         So, CBC mode is somehow useful.

            valeriep Valerie Peng
            skesunw Stuart Ke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: