Using binary data inside doFinal() - javax.crypto.Cipher?

If you're going to encrypt it anyway, XORing doesn't seem to accomplish anything.

If you're going to encrypt it anyway, XORing doesn't seem to accomplish anything. Beyond that cipherData is a misleading name: that's actually your (XORd) cleartext, since you are getting it from the decryption step. If you continue with the XOR scheme, you need to XOR those bytes again before attempting to decode them into a String.

When you do that step, you probably need to specify the encoding used, e.g. , UTF-8, just to be safe.

Because its a term project and xoring is a requirement. Im not happy with that, though :) I know that I have to xor the decrypted text to reach the original message. The problem is that; I cant get decrypted text properly because cipher.

Dofinal(data) doesn't return the right output... – Ismail Kuyu Mar 23 at 16:49 @Ismail Kuyu Try skipping the XOR step and verifying that the encryption/decryption is working properly. Since it's just byte data, it shouldn't matter, but it never hurts to chop out any complexity you can while debugging, then add it back later if you need it. – Hank Gay Mar 24 at 15:48 @Ismail Kuyu Also, are you sure that data is your ciphertext?

The name makes it sound like it may be the original plaintext. Can you slap together the smallest example that will recreate your problem and put it in your question? – Hank Gay Mar 24 at 16:16 hey, thanks a lot for your help.

Although I said that its a requirement, I go around it and use mode function instead of xor :) btw, en/decryption works properly since I did them before xor stuff. Again, thanks for help... – Ismail Kuyu Mar 25 at 22:18.

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