Dear Sir/Madam,

I'm currently using Crypt::OpenSSL::RSA module with perl linking with OpenSSL 
0.9.8h to encrypt/decrypt message and transport over HTTP POST request to Java 
application on the other side.  When Encrypting with the given public key, Java 
application can receive the data perfectly.  But when Java side encrypt message 
with private key (which is the pair for our public key), and reply back, we 
found the following error while trying to decrypt message:

RSA.xs:202: OpenSSL error: block type is not 01 at ...

Please kindly suggest how we could get around this issue.

Currently, we use PKCS1 padding.  Please kindly see below for our perl script 
used.

  $RSA_Decrypt = Crypt::OpenSSL::RSA->new_public_key( $PublicKey );
  $RSA_Decrypt->use_pkcs1_padding();
  my $TmpText = decode_base64( $CipherText );

  my $PlainText = $RSA_Decrypt->public_decrypt( $TmpText ); 
  #--> Error on the line above

Thank you and Best Regards,
Phakin Ch.


      
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to