This content has been marked as final. Show 3 replies
Though you have a line in your main program to print out the plain text you don't actually provide it! This makes it difficult for anyone to help.
Assuming that you know for certain that your key is correct, your iv is correct and you are using CBC block mode then the only thing I can see that could be wrong is that you are not using a valid decompression.
P.S. Please put [code ] tags round your code so that it displays better.
user11990145 wrote:Convert to bytes then Base64 encode it !
the forum doesn't allow me to post the string which is a xml.. not sure how to post it.. :((
I think it's a decompression issue too.. it's compressed using DeflateStream in c#. do you know the java version of this?Sorry no - never used DeflateStream. A quick Google search indicates that DeflateStream stream is very limited in what it can handle and I note some severe critics of it's algorithm; I have no idea how valid they are.
To prove your basic Java decryption code is correct you could write the decrypted bytes to a file and then deflate them using C# . If this works then you have isolated the problem to the decompression.
Edited by: sabre150 on Oct 21, 2012 5:28 PM