Skip to content

Instantly share code, notes, and snippets.

@chezsick
Last active April 8, 2019 23:09
Show Gist options
  • Save chezsick/90a7cc4cc60486e0b0c6b7927f4e838d to your computer and use it in GitHub Desktop.
Save chezsick/90a7cc4cc60486e0b0c6b7927f4e838d to your computer and use it in GitHub Desktop.
The Key Exchange Diffie Hellman For VideoCrypt, args :::: prog pub priv mod
import sys
fna = open(sys.argv[1],"r")
fnb = open(sys.argv[2],"r")
a = fna.readlines()
b = fnb.readlines()
g = len(a)
s = a[0]
y = int(s.split(";")[1])
z = int(s.split(";")[2])
for m in xrange(g):
aa = a[m]
bb = b[m]
aaa = int(aa.split(";")[0])
bbb = int(bb.split(";")[0])
n = pow(aaa,bbb,16777213)
if n == 0:
n = 1
sys.stdout.write("%s;%s;%s\r\n" %(n,y,z))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment