The error is because of the size of the data you are trying to encrypt.
Probably the txt file is smaller than your key, so you can encrypt it. But
the doc probably isn´t.

The data you are encrypting must be smaller than the key. If you want to
encrypt larger things, you should split the file befor encyprting. I don´t
think openssl can do that for you 9not sure, but I don´t think it will).
Anyway, you should not use RSA for large files. RSA is too slow for that.

2010/1/11 <bhagyashri.bi...@gmail.com>

> Hi,
>   I am trying to encrypt doc file using rsautl but it is giving me error as
> follows
> OpenSSL> rsautl -encrypt -inkey public.pem -pubin -in Mydoc.doc -out
> Myfile.ssl
> Loading 'screen' into random state - done
> RSA operation error
> 1184:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too
> large for
>  key size:.\crypto\rsa\rsa_pk1.c:151:
> error in rsautl
>
>  Why it is giving me error though same command works me well for .txt file
> ..
>  Waiting for your reply ..
>  Thanks in ad
>  Bhagyashri Katole
>  C-DAC, Pune
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
>

Reply via email to