aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/encryptor.py
diff options
context:
space:
mode:
authorYigit Sever2021-04-25 22:59:52 +0300
committerYigit Sever2021-04-25 22:59:52 +0300
commit6078fec593afcef1f2bb920b931daada09480f51 (patch)
treec7ed245478eb9f38cd90b504b18bdb48b8996387 /scripts/encryptor.py
parent16ef822d9c5a07e9efc35cc3c28c05b737777b5a (diff)
downloadgradecoin-real.tar.gz
gradecoin-real.tar.bz2
gradecoin-real.zip
Fix testsreal
Diffstat (limited to 'scripts/encryptor.py')
-rw-r--r--scripts/encryptor.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/encryptor.py b/scripts/encryptor.py
index 2dac487..ed0c1d8 100644
--- a/scripts/encryptor.py
+++ b/scripts/encryptor.py
@@ -12,6 +12,9 @@ def hex2bin(hexStr):
12 return binascii.unhexlify(hexStr) 12 return binascii.unhexlify(hexStr)
13 13
14iv = hex2bin("6e657665726d696e647468656e66756b") 14iv = hex2bin("6e657665726d696e647468656e66756b")
15
16iv_ready = base64.b64encode(iv)
17
15key = hex2bin("6e6565726d666e646e6565726d666e64") 18key = hex2bin("6e6565726d666e646e6565726d666e64")
16 19
17mode = CBC(iv) 20mode = CBC(iv)
@@ -67,3 +70,8 @@ asy_cipher = PKCS1_OAEP.new(publickey, hashAlgo=Crypto.Hash.SHA256)
67ciphertext = asy_cipher.encrypt(key) 70ciphertext = asy_cipher.encrypt(key)
68 71
69key = base64.b64encode(ciphertext) 72key = base64.b64encode(ciphertext)
73
74print(f'key: {key}')
75print(f'c: {c}')
76print(f'iv: {iv_ready}')
77