Click here to Skip to main content
15,891,033 members
Home / Discussions / Java
   

Java

 
QuestionParallel processing of two methods in main class Pin
Sachin k Rajput 1-Jun-13 0:30
Sachin k Rajput 1-Jun-13 0:30 
AnswerRe: Parallel processing of two methods in main class Pin
Richard MacCutchan1-Jun-13 4:28
mveRichard MacCutchan1-Jun-13 4:28 
QuestionPut and order values in a List Pin
Ghandil31-May-13 8:36
Ghandil31-May-13 8:36 
AnswerRe: Put and order values in a List Pin
Prasad Khandekar3-Jun-13 3:45
professionalPrasad Khandekar3-Jun-13 3:45 
QuestionCipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums31-May-13 6:40
Skippums31-May-13 6:40 
SuggestionRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta31-May-13 21:51
AlphaDeltaTheta31-May-13 21:51 
AnswerRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta31-May-13 22:06
AlphaDeltaTheta31-May-13 22:06 
GeneralRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums3-Jun-13 7:26
Skippums3-Jun-13 7:26 
Sorry, I should have clarified in my post; I know that the length of the encrypted byte array was correct at 32 bytes long. When I searched for an answer to my question, the first thing people trying to help ask is, "what is the length of your encrypted stream?" Most people were getting something that was NOT a multiple of the block size, which indicates the error is earlier than the read phase. I posted that information to try and "prove" that the error was during the read phase, and NOT during the write phase (especially since I can get the information out of the stream if I use it in a unique way).

As for your other answer, the code I posted was a minimal example of how to illustrate the problem, but in no way reflects how I am actually attempting to use the CipherInputStream/CipherOutputStream classes. Essentially, I am attempting to the interface to the crypto API significantly easier by creating a factory that returns a CipherInputStream/CipherOutputStream when the client passes in enumerated values for the cipher mode and padding mode.

And yes, you are correct that for AES the block size is 16 bytes. For now, I just created a class called CipherInputStreamWrapper, and overloaded the read(byte[], int, int) method to iteratively call CipherInputStream.read(). This approach works, but I think it illustrates a flaw in the underlying implementation of CipherInputStream in Java 6 and 7 (tested in both). Thank you for taking the time to answer my post, any other ideas as to how to solve this problem are welcome!
Sounds like somebody's got a case of the Mondays

-Jeff

AnswerRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums3-Jun-13 7:33
Skippums3-Jun-13 7:33 
SuggestionRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta3-Jun-13 17:05
AlphaDeltaTheta3-Jun-13 17:05 
GeneralRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums4-Jun-13 4:47
Skippums4-Jun-13 4:47 
AnswerRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta4-Jun-13 5:30
AlphaDeltaTheta4-Jun-13 5:30 
GeneralRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
Skippums4-Jun-13 6:33
Skippums4-Jun-13 6:33 
AnswerRe: CipherInputStream.read(byte[]) Dropping Final Block Pin
AlphaDeltaTheta4-Jun-13 6:41
AlphaDeltaTheta4-Jun-13 6:41 
QuestionNew in Java Pin
Garde33330-May-13 18:47
Garde33330-May-13 18:47 
QuestionRe: New in Java Pin
AlphaDeltaTheta30-May-13 20:42
AlphaDeltaTheta30-May-13 20:42 
AnswerRe: New in Java Pin
Garde33331-May-13 17:57
Garde33331-May-13 17:57 
AnswerRe: New in Java Pin
dusty_dex30-May-13 20:56
dusty_dex30-May-13 20:56 
AnswerRe: New in Java Pin
Richard MacCutchan30-May-13 21:18
mveRichard MacCutchan30-May-13 21:18 
GeneralRe: New in Java Pin
Garde33331-May-13 17:45
Garde33331-May-13 17:45 
GeneralRe: New in Java Pin
Richard MacCutchan31-May-13 21:41
mveRichard MacCutchan31-May-13 21:41 
GeneralRe: New in Java Pin
Pujara Jignesh2-Jun-13 0:12
Pujara Jignesh2-Jun-13 0:12 
AnswerRe: New in Java Pin
Amarnath S30-May-13 21:43
professionalAmarnath S30-May-13 21:43 
AnswerRe: New in Java Pin
jiyasharma18-Jun-13 1:48
jiyasharma18-Jun-13 1:48 
Questionin jsp Pin
Swamy Kandi30-May-13 2:02
Swamy Kandi30-May-13 2:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.