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

Dealing with left-padding using RSA #145

Open
kit-ty-kate opened this issue Apr 19, 2018 · 0 comments
Open

Dealing with left-padding using RSA #145

kit-ty-kate opened this issue Apr 19, 2018 · 0 comments

Comments

@kit-ty-kate
Copy link

kit-ty-kate commented Apr 19, 2018

According to the Nocrypto.Rsa.decrypt documentation:

[decrypt ~mask key ciphertext] is the decrypted [ciphertext],
left-padded with [0x00] up to [key] size.

I have several questions on this:

  • I don't know why this behaviour is noted here but not in encrypt which does the actual padding.
  • It says [key] size and maybe I'm missing something on how works RSA (most probably) but only [key] size / 8 is actually used (e.g. 256 for a 2048 key). Is this documented anywhere ?
  • Is there a way to remove them properly ? Do we have to pad ourself the string before encryption to be able to handle the string format ?

EDIT: Ok just realize how dumb was my second point but maybe there can be something in the doc saying something like [key] size (in octets) to be a bit more precise for noobies like me.

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

No branches or pull requests

1 participant