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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • None
    • 1.4.0
    • security-libs

      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.

            valeriep Valerie Peng
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: