Decrypting AES encrypted file in C# with java?

Your current use of the string constructor will use the platform default encoding - almost never a good idea You're assuming that a single call to read() will read everything - you're not actually using the value of iRead later You're assuming that all the data will fit in a 1024-byte buffer It's hard to know which of those is causing the problem. I would strongly suggest that you use a CipherInputStream to wrap your FileInputStream, and then wrap an InputStreamReader around that, using the appropriate encoding. You could then use something like Guava's CharStreams.toString() method to read everything from the InputStreamReader into a string.

EDIT: As noted in comments, while all of these are potential problems, there's also the matter of the code currently creating the Cipher in encryption mode rather than decryption mode.

You're right about those points, but I'm actually testing with a sample data which I know will be small. But the real problem turned out to be that I am using Cipher. ENCRYPT_MODE instead of Cipher.

DECRYPT_MODE. A stupid mistake, but I realized it just now as I was revising your points. Thanks for your help Jon.

– Sebouh Jun 7 at 12:35 @Sebouh: I've edited my answer to note that, for future readers. – Jon Skeet Jun 7 at 12:44.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions