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

generating public key having public modulus and exponent

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
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) 


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