My encryption function return byte[] and I encode it to string to be able to send it also I add some other data to this string and then in the other side I break it again and get the encrypted part off and then again turn it back to byte[] form. When I try to decrypt it an error is raised:
Expand|Select|Wrap|Line Numbers
- Exception in thread "main" javax.crypto.BadPaddingException: Data must start with zero
- at sun.security.rsa.RSAPadding.unpadV15(Unknown Source)
- at sun.security.rsa.RSAPadding.unpad(Unknown Source)
- at com.sun.crypto.provider.RSACipher.a(DashoA13*..)
- at com.sun.crypto.provider.RSACipher.engineDoFinal(DashoA13*..)
- at javax.crypto.Cipher.doFinal(DashoA13*..)
Can anyone help me to solve that?