Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable padding for encrypt method #170

Open
sourav2029 opened this issue Jun 6, 2018 · 0 comments
Open

How to disable padding for encrypt method #170

sourav2029 opened this issue Jun 6, 2018 · 0 comments

Comments

@sourav2029
Copy link

sourav2029 commented Jun 6, 2018

The doc: https://www.npmjs.com/package/ursa#public-key-methods states that the input buffer is limited to be no larger than the key size minus 41 bytes.

I tried disabling the padding that is used by passing RSA_NO_PADDING option, but it also doesn't work.

The error that I get is : error:0406B06E:rsa routines:RSA_padding_add_none:data too large for key size.

My input length is 256 bytes.

If it helps, I am trying to replicate some python code which uses this function:https://www.dlitz.net/software/pycrypto/api/current/Crypto.PublicKey.RSA._RSAobj-class.html#encrypt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant