1
$\begingroup$

i want to generate an RSA public public key file using openssl (or other tools) having public modulus and exponent, so i can use it later to encrypt files

i have this:

the modulus: 

"BEB90F8AF5D8A7C7DA8CA74AC43E1EE8A48E6860C0D46A5D690BEA082E3A74E1"
+"571F2C58E94EE339862A49A811A31BB4A48F41B3BCDFD054C3443BB610B5418B"
+"3CBAFAE7936E1BE2AFD2E0DF865A6E59C2B8DF1E8D5702567D0A9650CB07A43D"
+"E39020969DF0997FCA587D9A8AE4627CF18477EC06765DF3AA8FB459DD4C9AF3"

the exponent: 0x10001

so how can i generate the public key from those, so i can use it to encrypt some data, or maybe there's a way to use these directly for encryption ?

$\endgroup$

closed as unclear what you're asking by Gilles, otus, yyyyyyy, Maarten Bodewes, Henrick Hellström Oct 1 '15 at 21:35

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ That is great you want to do that! What is your question? What have you tried? $\endgroup$ – mikeazo Sep 29 '15 at 12:09
  • $\begingroup$ i couldn't find anything, apparently i can do the inverse; getting the modulus and exponent form a public key $\endgroup$ – Issam Führer Sep 29 '15 at 12:40
  • 1
    $\begingroup$ What format is everything in right now? $\endgroup$ – mikeazo Sep 29 '15 at 12:54
  • $\begingroup$ When I need to do the same, I use a python module. Here you'll find the doc: dlitz.net/software/pycrypto/api/current/… You just need two integers (modulus and public exponent), then you export it with the RSA.export('PEM') function. (Give a look to the examples) $\endgroup$ – ddddavidee Sep 29 '15 at 13:12
  • $\begingroup$ thx that would help $\endgroup$ – Issam Führer Sep 29 '15 at 16:54
1
$\begingroup$

i got this, it's not with openssl, but python

e = 0x10001
N = 0x1234214....

words = open("words.txt").read().split()

for w in words:
     ww = int(w.encode("hex"), 16)
     print pow(ww, e, N) 
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.