Merge pull request #3 from Necron3574/master

Create PhaseStream1.py
This commit is contained in:
Haseeb Khalid 2021-10-02 01:14:50 +05:30 committed by GitHub
commit 66f584aed8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

17
CHTBCTF/PhaseStream1.py Normal file
View file

@ -0,0 +1,17 @@
from Crypto.Util.number import *;
def xor(bstr1,bstr2):
ans = ""
for i,j in zip(bstr1,bstr2):
ans += chr(i^j)
return ans
ct = "2e313f2702184c5a0b1e321205550e03261b094d5c171f56011904"
ct = int(ct,16)
ct = long_to_bytes(ct)
key = chr(ct[0]^ord('C')) + chr(ct[1]^ord('H')) + chr(ct[2]^ord('T'))+chr(ct[3]^ord('B'))+chr(ct[4]^ord('{'))
pt = ""
for i in range(len(ct)):
pt += chr(ct[i] ^ ord(key[i%5]))
print(pt)