Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Encrypt and Decrypt

Reply
Thread Tools

Encrypt and Decrypt

 
 
Bhimashankar
Guest
Posts: n/a
 
      08-17-2009
Hi All,
Please help me to resolve the follwing the exception while Encrypt and
Decrypt the

javax.crypto.IllegalBlockSizeException: Input length must be multiple
of 8 when decrypting with padded cipher
at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
 
Reply With Quote
 
 
 
 
Andreas Leitgeb
Guest
Posts: n/a
 
      08-17-2009
Bhimashankar <> wrote:
> Hi All,
> Please help me to resolve the follwing the exception while Encrypt and
> Decrypt the
> javax.crypto.IllegalBlockSizeException: Input length must be multiple
> of 8 when decrypting with padded cipher
> at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
> at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)


If *de*crypting fails, mentioning a wrongly-sized input, then
something went wrong with gathering the crypted data or passing
it to the decrypter.

If you read in the data from a file, perhaps some kind of
conversion was applied to it (e.g. CrLf->Lf) or some extra
encoding that was applied on the crpto-text (e.g. base64)
wasn't undone before decrypting.

An "sscce" (<http://sscce.org/>) would surely help *you* (by
allowing us to spot the error in your code). But even just
an excerpt of your code may suffice, if you happen to post
the right excerpt (the one that actually contains the bug).

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      08-17-2009
On Mon, 17 Aug 2009 05:36:29 -0700 (PDT), Bhimashankar
<> wrote, quoted or indirectly quoted someone who
said :

>javax.crypto.IllegalBlockSizeException: Input length must be multiple
>of 8 when decrypting with padded cipher


see:
http://mindprod.com/jgloss/runerrorm...KSIZEEXCEPTION
--
Roedy Green Canadian Mind Products
http://mindprod.com

"If you think it’s expensive to hire a professional to do the job, wait until you hire an amateur."
~ Red Adair (born: 1915-06-18 died: 2004-08-07 at age: 89)
 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      08-22-2009
rossum wrote:
> On Mon, 17 Aug 2009 05:36:29 -0700 (PDT), Bhimashankar
> <> wrote:
>> Please help me to resolve the follwing the exception while Encrypt and
>> Decrypt the
>>
>> javax.crypto.IllegalBlockSizeException: Input length must be multiple
>> of 8 when decrypting with padded cipher
>> at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)
>> at com.sun.crypto.provider.SunJCE_h.b(DashoA12275)

> Assuming that you are using a block cypher in CBC mode, then your
> input plaintext will be padded to a whole number of blocks. This
> means that your cyphertext will be longer than the original plaintext.
> If you leave off the extra cyphertext then you will get the error you
> are seeing.


I would say that the padding depends on padding not on mode.

Arne

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
decrypt challenge - perl encrypt with ruby decrypt aktxyz@gmail.com Ruby 1 06-16-2007 01:30 PM
how to encrypt a C data and write a bin file and read a bin at run time and decrypt C data sweety C Programming 9 02-07-2006 05:28 PM
Can one make up one's own cookie encrypt and decrypt keys? Randall Parker ASP .Net 0 12-04-2005 06:55 PM
FormsAuthentication.Encrypt and Decrypt not playing nicely =?Utf-8?B?TWlrZQ==?= ASP .Net 0 08-31-2005 07:59 PM
Can you encrypt and decrypt CDs and CDRWs ? Allen Computer Support 0 10-20-2004 08:14 AM



Advertisments