Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Problem with javax.crypto.CipherOutputStream

2836446Jan 9 2015 — edited Jan 9 2015

Hi, i have a problem with using the javax.crypto.CipherOutputStream-Class in AEAD mode.

I try to encrypt a file andthat seems to work properly.

But if i try to decrypt this file, the file will be created but the size is 0 byte.

I don't know if it's a Bug in the CipherOutputStream-class or have I misunderstood something?

ciper is in AEAD mode...

but if i try to encrypt and to decrypt data without using CipherInputStream and CipherOutputStream it will be works fine...

cipher = Cipher.getInstance("AES/GCM/PKCS5Padding");

cipher.init(cipherMode, secret, new GCMParameterSpec(128, nonce));

....

....


CipherOutputStream  cos = new CipherOutputStream(encryptedOutStream, cipher);

        int blockSize = cipher.getBlockSize();

        while ((n = inputStream.read(byteBuffer)) != -1) {

            cos.write(byteBuffer, 0, n);

        }

        cipher.updateAAD(ad);

        cos.close();

        encryptedOutStream.close();

        inputStream.close();

Comments

2909966

We are having the same problem but only on some computers.  I have an iMac running Yosemite v10.10.2 and I get a coffee cup icon when I install our app through Java Web Start.  However, my friend who has a MacBook Pro also running Yosemite v10.10.2 gets the correct icon.  We are both running Java 8 Update 40.

jlanawalt

Is the JNLP for this application publicly available so we could check it against ours?

2909966

The JNLP is at:

http://services.sportsoptions.com/SO/SO-client.jnlp

Just so you know, this JNLP requests all permissions, but you can of course view the JNLP without giving it the permissions.

Does your JNLP work on some Macs?  This one installs the correct icon on Windows, Linux, and some Macs, but not on all Macs.

Vijayasri

Hi,

Did you find a solution to the issue?

I am facing the same problem on macbook pro (Yosemite 10.10.2) with JRE 8 u45. Just the desktop shortcuts are incorrect icons. At other places like Java cache viewer, desktop folder, Get Info dialog...the icons are shown correctly.

Thanks,

Vijayasri

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 6 2015
Added on Jan 9 2015
0 comments
670 views