AES algorithm with IBM JCE on iSeries machine issue

Discussion in 'Java' started by mav, Jun 29, 2005.

  1. mav

    mav Guest

    NOTE: This message is about IBM iSeries JAVA programming with the
    IBMJCE.

    I am testing my Java code on the iSeries and continue to run in to a
    persistent issue. I have made a cryptographic provider for Java as a
    project, and it works perfectly on Windows. However, I run into an
    issue on the iSeries when I attempt to use the AES (Rijndael)
    algorithm. Here's the code I run:

    SecretKeyFactory aesFactory = SecretKeyFactory.getInstance("AES");
    SecretKeySpec x = new SecretKeySpec(aes256Key, 0, 32, "AES");
    System.out.println("Pre generateSecret() Size: " +
    x.getEncoded().length);
    aesKey = aesFactory.generateSecret(x);
    System.out.println("Post generateSecret() Size: " +
    aesKey.getEncoded().length);

    The variable "aes256Key" is a filled byte array of length 32. When
    I run this code, I get an output like the following:

    Pre generateSecret() Size: 32
    Post generateSecret() Size: 16

    When I print the arrays, the Post-generateSecret() array is exactly the
    first 16 bytes of the pre-genarateSecret() array. (i.e., if the
    "Pre" array is <0,1,2,3,...,31>, the "Post" array is
    <0,1,2,3...15>). However, no error was thrown; the array was just
    truncated.

    I thought this was an issue with the Unlimited Strength Jurisdiction
    Policy Files, but the behavior remained the same when I updated them.
    I also attempted to do this with TripleDES instead of AES, but the code
    worked fine.

    Does the IBM JCE limit AES to 128-bits without even throwing an error?
    Any insight would be greatly appreciated.

    Thank you very much,
    -Matt
     
    mav, Jun 29, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Love

    JCE and DES

    Rob Love, Aug 18, 2003, in forum: Java
    Replies:
    0
    Views:
    465
    Rob Love
    Aug 18, 2003
  2. Carsten Zerbst

    Simple CA using SUN JCE ?

    Carsten Zerbst, Feb 3, 2004, in forum: Java
    Replies:
    0
    Views:
    388
    Carsten Zerbst
    Feb 3, 2004
  3. Robert Wells
    Replies:
    4
    Views:
    698
    Default User
    Jun 24, 2008
  4. Qu0ll
    Replies:
    42
    Views:
    1,312
    Thufir Hawat
    Apr 13, 2009
  5. Nate Wiger

    New AES gem available -- fast-aes

    Nate Wiger, Jan 20, 2010, in forum: Ruby
    Replies:
    3
    Views:
    225
    Pål Bergström
    Jul 1, 2010
Loading...

Share This Page