Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

generating public key having public modulus and exponent

hi !

im having this trouble for weeks and can't find a solution

i have the public modulus and exponent and want to generate the public key to encrypt files using it

i can't find anything neither on the web nor on the openssl man pages (im using linux)

do some body have an idea or a tool to do this ?!
http://crypto.stackexchange.com/question...d-exponent

So I assume this is you?
When you gaze into the abyss the abyss too gazes into you.



CyberSec Ops || Rip Tay.AI

Vivere est cogitare; vivere militare est: Zantha Invicta

so any help u can give ? PS: revisit the link again
Why would you wanna encrypt files with RSA? You do know that you can only encrypt data that is smaller than your modulus? So you would have to split up your files in blocks and encrypt them block by block and whatnot.

The way to do it, is to create an AES key. Use that key to symmetrically encrypt your files and then use RSA to encrypt your AES key.

Now I don't know how you can import it into openssl, but really you can just do your math yourself: All you need to do is to raise your AES key to the power of your public exponent e and then reduce by your modulus.
Code
key^e mod N
actually i don't want to encrypt files, i just want to encrypt a list of words one by one, and i have to encrypt them with the public key that much the modulus i have, but i don't have the public key that's the problem

i know this looks weird, why i am doing this in the first place. i have some reasons and i only need some help :)
You do realize that the public exponent e and your modulus is your public key?

If you want to encrypt words you simply do the following in python:

PHP Code

<?php 
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) 
thanks, actually that would work :)

i just downloaded a bunch of python books, i should learn it !


Possibly Related Threads...
Thread / Author Replies Views Last Post
by bexpr9Aug 24, 2019 10:32 AM 9 386 Aug 24, 2019 10:32 AM
Last Post: Silkroad
by XapesyDec 21, 2017 04:15 PM 8 446 Dec 21, 2017 04:15 PM
Last Post: Yattaze
by Zeppster1995May 24, 2017 03:57 AM 1 164 May 24, 2017 03:57 AM
Last Post: justmycode