File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes decryption problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "decryption problem..." Watch "decryption problem..." New topic

decryption problem...

Muneeb Kiani

Joined: Sep 08, 2011
Posts: 5

i'm trying to implement a chat between client(j2me) and server(j2se), and all the communication will be encrypted(using RSA)... i'm using iaik-jce-me api for cryptography on both side... i m facing a problem, when i'm trying to decrypt a message on other side it throw an exception Invalid PKCS#1 padding: length of encrypted message does not match modulus length! or Invalid PKCS#1 padding: no leading zero! and sometimes it decrypt... please help me if anyone is familiar with such type of exception

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17260

I think the first thing you need to do is make sure that the encryption process isn't causing you to send/receive binary data over text transmission channels.

An IDE is no substitute for an Intelligent Developer.
subject: decryption problem...
jQuery in Action, 3rd edition