I have to generate two keys (private and public) to encrypt a text with the public and let the user with the private key decrypt the text.
Is it possible with the module Crypto?
Crypto 기본 모듈을 사용해 RSA 의 키로 암복호화 하는 방법을 알아 봅시다. 일단 그 전에 OpenSSL로 RSA Private Key, Public Key 를 생성합니다. C:UsersPublicopenssl genrsa -out private.key 2048 Generating RSA private key, 2048 bit long modulus. May 14, 2013 Generate a RSA PEM key pair from pure JS. Contribute to juliangruber/keypair development by creating an account on GitHub. RFC 7748 also does not explicitly define how the key pair is generated. There exists a good amount of code on Github in various languages, so it seems there are some out there than can read C code, but where is the specification in its generation? It appears that generating the private key is straight forward, although why isn't clear to me.
Thank you!
![]()
Answers:
The following code works, but I’m not a professional cryptographer, so some comments here would be useful.
I’ve used the ursa RSA module, instead of crypto.
I am concerned that if similar data were encrypted directly, without a pass of AES or similar, then it might be trivial to break this. Comments please…
After some further investigation http://en.wikipedia.org/w/index.php?title=RSA_%28cryptosystem%29§ion=12#Attacks_against_plain_RSA it looks like ursa already does padding.
Answers:
Use the crypto module from npm to generate KeyPair.
Generate Rsa Key Pair Node Js Crypto Currency
Above is a example snippet. To know more checkout documentation http://nodejs.org/api/crypto.html
Answers:
![]()
If you know how to get what you want from OpenSSL, I think it’s perfectly reasonable to run OpenSSL using Node’s
child_process .
Answers:
child_process route is a terrible and non-scalable solution imo. Stay away.
I chose to go with keypair instead.
Cheers
Generate Rsa Key Pair Node Js Crypto Module
Answers:
I have not used it, but this may be useful:
Documentation is severely lacking on this (no examples that I could find).
Answers:
Generate Rsa Key Pair Node Js Crypto Price
You can use this rsa-json module. It just spawns a openssl process, so it is pretty dependent on the OS (it does not work by default on windows).
Tags: node.js
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |