• Post Reply Bookmark Topic Watch Topic
  • New Topic

exception while decrypting a String  RSS feed

 
Giovanni Boccacaprina
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys.

I have been trying to encrypt with the Cipher class for a while now and I'm still getting issues. I'm having problems with the padding and with the byte array size. I receive this exception "Input length must be multiple of 8 when decrypting with padded cipher" This is the code I wrote:



I also tried using Hex instead of Base64 and I'm receiving this exception: "Given final block not properly padded"

please help me out, to find error. thanks in advance.
 
Giovanni Boccacaprina
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nevermind guys thanks
I found a fix for this

I had to use the Base64 decoder before decrypting the message
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!