Hello,
> I have a xml message that has the symmetric key encrypted with a public 
key of the 
> server, the xml is like
> 
> <xenc:CipherData>
> <xenc:CipherValue>gIXImWs5Es6mlErowIU/TLWmqqSCsVT+quyRb1ULza1033A7SFT
> +4RVXG00D5463QyrnGFN3zQhv
> 
PgAhbODOCiwm8MXyiiRQmB2Eg3uW1vWf7DevANQ8XAXw2rW4EkDLYzRpyR+kUOnJ5XGqpGjwCE8D
> zTlCMswnYufhD4p7tVk=
>      </xenc:CipherValue>
> 
> I took the value between <xenc:CipherValue>...</xenc:CipherValue> and 
stored in in the 
> file. I later modified the file to contain 64 chars per line and then 
ran below commands
> 
> 1) openssl enc -base64 -d -in <file name> -out <decoded file name>
> 
> <decode file name> was created and it had binary contents. Now I went 
step further
> 
> 2) openssl rsautl -decrypt -inkey <privkey.pem> -out <output symmetric 
key file name> -pkcs
> 
> I was expecting step 2 to work but instead go the error
> 
> RSA operation error
> 4696:error:0407106B:rsa routines:RSA_padding_check_PKCS1_type_2:block 
type is no
> t 02:.\crypto\rsa\rsa_pk1.c:190:
> 4696:error:04065072:rsa routines:RSA_EAY_PRIVATE_DECRYPT:padding check 
failed:.\
> crypto\rsa\rsa_eay.c:596:
You may try use -raw instead of -pkcs to decrypt data with server private 
key
and then check if you get something reasonable after decryption.
You must ensure that encrypting public key and decrypting private key
are from the same pair. 

Best regards,
--
Marek Marcola <[EMAIL PROTECTED]>

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

Reply via email to