• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

exception while decrypting a String

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic