示例#1
0
文件: ec2mpi.py 项目: mumrah/ec2mpi
 def gen_mpi_key():
     pub, pri = util.genKey()
     keyname = raw_input("Choose a name for the key (q to Quit): ")
     while 1:
         if keyname == "q":
             exit()
         elif keyname == "":
             keyname = raw_input("Choose a name for the key (q to Quit): ")
         elif bucket.get_key("id-%s" % keyname):
             print "That key name is already in use."
             keyname = raw_input("Choose a name for the key (q to Quit): ")
         else:
             break
     keyname = keyname.replace(" ", "-")
     pub_key = bucket.new_key("id-%s.pub" % keyname)
     pub_key.set_contents_from_string(s=pub, policy="private")
     pri_key = bucket.new_key("id-%s" % keyname)
     pri_key.set_contents_from_string(s=pri, policy="private")
     return keyname
示例#2
0
文件: key.py 项目: chnxyzz/Wargames
import util

padchar = 'A'
(p, q), N = util.genKey(1024)

p = 12716795933303046439883985133206568651800727459082108076540122730281649707218637917233431186104080427487005200961260674559436133910118906406831786959878007
q = 13034103868293556962925024008453553523621351203719798559783361102665614797778749823144453591121726712430967766321008837549224354864468178323558779647265479
N = 165752039066565011610593218583129322316755573734493004253802323087121390743169798069827240445252171405285059943217990071313492266655877987053486579193979697308720002274191979491764685736189772791061360365927537602897855800838399852922649692267089866544036755916892232533995226123404963061641392884844982420353

print 'p:', p
print 'q:', q
print 'N:', N
示例#3
0
文件: key.py 项目: rot256/Wargames
import util


padchar = 'A'
(p,q), N = util.genKey(1024)


p = 12716795933303046439883985133206568651800727459082108076540122730281649707218637917233431186104080427487005200961260674559436133910118906406831786959878007
q = 13034103868293556962925024008453553523621351203719798559783361102665614797778749823144453591121726712430967766321008837549224354864468178323558779647265479
N = 165752039066565011610593218583129322316755573734493004253802323087121390743169798069827240445252171405285059943217990071313492266655877987053486579193979697308720002274191979491764685736189772791061360365927537602897855800838399852922649692267089866544036755916892232533995226123404963061641392884844982420353

print 'p:', p
print 'q:', q
print 'N:', N