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

No cipher.init() can pass block size into cipher when using AES

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: security-libs
    • Labels:

      Description

      AES is different with other cryptography algorithms since it can implement different block size(128, 192, 256). The current Cipher API has no such method to treat different block size. This can cause interoperability problem. For example, if some vender use 256 block size AES to encrypt some data, current JCE cipher has no way to decrypt it since it don't know the encryption block size.

      So, at least, adding a new init method in Cipher class is necessary.

      init(into opmode, Key key, AlgorithmParameters params, int blockSize);

      Another way is that putting blocks size into AlgorithmParameters. and add methods setBlockSize(int), getBlockSize() etc, in AlgorithmParameters class.

        Attachments

          Activity

            People

            • Assignee:
              valeriep Valerie Peng
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: