[erlang-questions] crypto rsa encryption

trevorw@REDACTED trevorw@REDACTED
Thu Oct 28 19:40:57 CEST 2010


> Hello.
>
> I'm trying to get rsa encryption with crypto module. With PKCS1 padding
> scheme it works ok, but 'rsa_no_padding' option makes
> crypto:rsa_public_encrypt to raise:
> ** exception error: encrypt_failed.
>
> My system:
> otp: R13B03, R13B04, R14B
> Ubuntu 9.10
> OpenSSL 0.9.8g 19 Oct 2007
>
> Any ideas what the problem is?
>
> --
> Sergei Fomin
>

Hi Sergei

With RSA_NO_PADDING the size of your input needs to be exactly the same
size as your RSA key, otherwise you need to add padding yourself.

Regards,
Trevor




More information about the erlang-questions mailing list