in Education by
I am trying to decrypt some data from a DB and have run into some AEADBadTagExceptions, but not always. While searching for the error, I have taken the cipher initialization and put a loop around the decryption. I.e. GCMParameterSpec parameterSpec = new GCMParameterSpec(authenticationTagLength, ivByte); cipher = Cipher.getInstance(AES_MODE_GCM); cipher.init(Cipher.DECRYPT_MODE, secretKey, parameterSpec); if (additionalDataText.length()>0) { cipher.updateAAD(additionalDataText.getBytes("UTF-8")); } } for(int i = 0; i < 500; i++) { cipher.doFinal(cypherBytes); } Running this code several times, I get 17/500 successes on the first try, then Zero for the next several tries. Changing the code and letting Eclipse rebuild may yield 17 or 18 successes followed by failures. The exception is as follows [err] javax.crypto.AEADBadTagException [err] at com.ibm.crypto.provider.GCTRInHardware.gcm_ad(Unknown Source) [err] at com.ibm.crypto.provider.aA.c(Unknown Source) [err] at com.ibm.crypto.provider.AESGCMCipher.engineDoFinal(Unknown Source) [err] at com.ibm.crypto.provider.AESGCMCipher.engineDoFinal(Unknown Source) [err] at javax.crypto.Cipher.doFinal(Unknown Source) Oh yeah, I'm using Java 1.8 on the "IBM J9 VM" if that helps. Does anyone have any idea what might prompt this behaviour? Kind regards Edit: in additional news, this seems to be caused by something on the server this is running on - I can successfully decrypt the same data on another server, and in a JUnit test. I'll have a look to see if I can find the difference in the configurations. Solution In my jvm.options I had specified a YourKit profiler under the option -agentpath By removing this line from the options, I got it to work. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Alright, I didn't know this was going to be relevant: I am running a Websphere Liberty Profile server. As mentioned in my edit, the code works in JUnit and on another server. I've checked the differences and got it to work, so I redid the differences one by one and found it was the following: In my jvm.options I had specified a YourKit profiler under the option -agentpath By removing this line from the options, I got it to work. Not sure what the etiquette is on answering your own questions, so I'll also add this to the question.

Related questions

0 votes
    I would like to know if Firebase Cloud Messaging is free or not for unlimited users? Select the correct answer from above options...
asked Feb 1, 2022 in Education by JackTerrance
0 votes
    I'm getting below error while fetching a response from SOAP service from a java client: [javax.xml.bind ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    Calling javax.persistence.criteria.Path.get(String name) fails for the simple class hierarchy detailed below. The ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    QTP doesn’t have any inbuilt support to connect to databases. Then, how can you connect to a database?...
asked Oct 19, 2020 in Technology by JackTerrance
0 votes
    Crypto analysis is used ___________. A. to encrypt the data B. to find some insecurity in a cryptographic scheme C. to increase the speed D. None of the options...
asked Nov 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to change encryption algorithm of existing project. But i have a little bit confusion. When i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 24, 2022 in Education by JackTerrance
0 votes
    I'm considering the following: I have some data stream which I'd like to protect as secure as ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I'm considering the following: I have some data stream which I'd like to protect as secure as ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 15, 2022 in Education by JackTerrance
0 votes
    AES stands for ________________ (a) Advanced Encryption Security (b) Advanced Encryption Standard (c) Advanced ... Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    AES is at least 6-times faster than 3-DES. (a) True (b) False The question was asked in homework. ... ?,Need-for-Cyber Security:,Cyber Security-Jobs:,Cyber Security Applications...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    What is the feature that doesn't belongs to pattern classification in feeddorward neural networks? (a) recall is direct ... units (d) two layers Please answer the above question....
asked Sep 4, 2022 in Education by JackTerrance
0 votes
    What is the feature that doesn't belongs to pattern mapping in feeddorward neural networks? (a) recall is direct (b ... units (d) two layers Please answer the above question....
asked Sep 4, 2022 in Education by JackTerrance
0 votes
    Why does change in temperature doesn't effect stochastic update? (a) shape landscape depends on the network and ... function which is fixed Please answer the above question....
asked Aug 30, 2022 in Education by JackTerrance
0 votes
    Is it possible in stochastic network that average state of network doesn't change with time? (a) yes (b) ... Neural Networks of Neural Networks Please answer the above question....
asked Aug 27, 2022 in Education by JackTerrance
0 votes
    I made a website and turned it into Android app, using Phonegap website. I have files stored on a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 11, 2022 in Education by JackTerrance
...