Created
July 23, 2017 03:09
-
-
Save 0x6d61/2c75c007bab7731541b3f9494224e742 to your computer and use it in GitHub Desktop.
This program creates an onion domain.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.PublicKey import RSA | |
import hashlib | |
import base64 | |
import sys | |
def OnionDomainGen(): | |
RSAkey = RSA.generate(1024) | |
privateKey = RSAkey.exportKey('PEM') | |
publicKey = RSAkey.publickey().exportKey('DER') | |
hash = hashlib.sha1() | |
hash.update(publicKey) | |
sha1 = hash.digest() | |
return (base64.b32encode(sha1[0:10]),privateKey) | |
while True: | |
domain,key = OnionDomainGen() | |
print "{0}.onion".format(domain.lower()) | |
if domain.lower().startswith(sys.argv[1]): | |
print "Onion Domain: {0}.onion\n".format(domain.lower()) | |
print key | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment