Home  >  Q&A  >  body text

node.js - How to generate RSA public key in pem format knowing n and e

The problem now is that I know n and e and want to generate a public key in pem format that can be used by OpenSSL.
I found a node.js library node-rsa, but this library requires e to be a js number, that is It says that it can be up to 53 digits, but my e has 160 digits. I don’t know if there is a problem with my e.
So I came here for help. I hope someone familiar with rsa can tell me how to generate a public key, or tell me the tool. If you can do it (regardless of language), thank you very much.

阿神阿神2684 days ago701

reply all(1)I'll reply

  • 阿神

    阿神2017-05-16 13:26:02

    A is plaintext and B is ciphertext, then B = A * 2 ^ e mod n.

    reply
    0
  • Cancelreply