Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from os import path, getcwd
- from secrets import randbelow
- __location__ = path.realpath(
- path.join(getcwd(), path.dirname(__file__)))
- # RFC 3526 2048-bit
- f = open(__location__ + "\\prime.txt", "r")
- p = int(f.read(),16)
- g = 2
- print(p)
- a = randbelow(p-1)+1
- b = randbelow(p-1)+1
- ga = (g**a)%p
- gb = (g**b)%p
- gab1 = (ga**b)%p
- gab2 = (gb**a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement