Commits

Anonymous committed 3598d90

Updated demo to show "static" private key setup.

  • Participants
  • Parent commits 7950c99

Comments (0)

Files changed (1)

File demo_pk_rsa_sign.py

 f = open(fname)
 s = f.read()
 f.close()
-y = Python_RSAKey.parsePEM(s)
+USE_PEM = True
+#USE_PEM = False
+if USE_PEM:
+    y = Python_RSAKey.parsePEM(s)
+else:
+    y = Python_RSAKey(n=157244339360204247653239817319181279042798167765599681551078798478498314510762245287381705503349288173388120379090829089007901242373585770293774008027007864466939855714436521772367227156172212108783392321162802438941044894131351349985075146769469105615537369016737802063374107423096788498942190189211581984333,
+        e=65537,
+        q=12131232405012378320501259670672806733704803591494641459972764196710715811913972478255716457743180787746728218696989805447770985157380497467186276802842577,
+        p=12961942703796037000589740628868246256085455817256173594946727923853311063893194558981303479733163765695316095844051741312582418034750566294170289827344829,
+        d=13880075426076591431923834523879086611571896799121018016891082124572573499622497047278684809144080932649499922075170457602739043397335759664761625287032368750129378226823514136162895406464511666885289911873624355707646478319947373471509976164625180818967026527541214352369977307447357294172402014081374584513,
+        dP=5984641107682138083843400852784293810563342960073768356950929097271424378325894901509304087664156161956979564889225348129719568904794503646723206736433269,
+        dQ=5342132950984287323644145354465678965084160575713495468740009074523875953001163399643864946068147726236638485002290702736205054116636421516135861399362753,
+        qInv=12346788191732912801705920468904773433573906238662991708909008782243876588454327555192926836655637091187903781383777248720017315682576234086142291458032109
+        )
 
-print 'n', y.n
-print 'e', y.e
-print 'd (private)', y.d
+print 'public'
+print '\tn', y.n
+print '\te', y.e
+print 'private'
+print '\tq', y.q
+print '\tp', y.p
+print '\td', y.d
+print '\tdP', y.dP
+print '\tdQ', y.dQ
+print '\tqInv', y.qInv
 plain_text = 'hello'
 print 'plain_text', repr(plain_text)