Advertisement
Narayan

test-key

Oct 7th, 2023 (edited)
1,585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import random
  4.  
  5. priv_key = random.getrandbits(256)
  6. print("Private Key is:", hex(priv_key))
  7.  
  8. G = {
  9.         'x': 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798,
  10.         'y': 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
  11.     }
  12. print("G point is:", G)
  13.  
  14. pub_key = {
  15.             'x_pub': G['x'] * priv_key,
  16.             'y_pub': G['y'] * priv_key
  17.           }
  18. print("Public Key is:", pub_key)
  19. print("x Public Key in Hex:", hex(pub_key['x_pub']))
  20. print("y Public Key in Hex:", hex(pub_key['y_pub']))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement