[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: [iaik-jce] Padding problem



Hello,

it means that the length of the data to be RSA-decrypted does not match to
the length of the key modulus. You may pass only the 128 byte encrypted
session key to the RSA cipher, rather than whole the 140 byte blob.

Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at
[mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von NIRAV KAKU
Gesendet: Freitag, 20. Oktober 2000 04:57
An: iaik-jce@iaik.tu-graz.ac.at
Betreff: [iaik-jce] Padding problem


Hello,

	I keep getting a BadPaddingException everytime I try to decrypt
with an asymettric key. Here's the case...

	I use MSCryptoAPI to generate a session key. Then I encrypt that
session key with the receivers publickey. All's well... I guess a
140byte blob of the encrypted session key (12 bytes for the header
and 128 bytes for the encrypted session key). I used an RSA engine
with RSA keys to do this.

	I bring this blob over to JAVA IAIK provider. Initialise the
cipher object in with RSA / DECRYPT_MODE / the receivers private key.
And that's where it gives me 'BadPaddingException: The encrypted data
is not k OCTETS long'. What does this mean and how do I get around it?

NIRAV KAKU
- Thought anonymous -
I have forgot how beautiful the stars look. I must look up again.
--
Mailinglist-archive at
http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

To unsubscribe send an email to listserv@iaik.at with the folowing content:
UNSUBSCRIBE iaik-jce




***************************************************************************
*                                                                         *
* IAIK S/MIME Mapper Security Info                                        *
* ===================================                                     *
*                                                                         *
* for message:                                                            *
*   From: "Dieter Bratko" <Dieter.Bratko@iaik.at>                         *
*   Date: Fri, 27 Oct 2000 22:36:01 +0200                                 *
*   Subject: AW: [iaik-jce] Padding problem                               *
*                                                                         *
* Message S/MIME properties:                                              *
*                                                                         *
*   Encrypted using:    not encrypted                                     *
*                                                                         *
*   Digitally signed:   yes                                               *
*   Signature valid:    yes                                               *
*   Signature trusted:  yes                                               *
*                                                                         *
*                                                                         *
* Compliance with policy for email addresses *@iaik.at:                   *
*                                                                         *
*   Encryption:         OK (None or better required)                      *
*                                                                         *
*   Digital Signature:  OK (digital signature required)                   *
*                                                                         *
***************************************************************************