diff options
author | Yigit Sever | 2021-04-25 22:59:52 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-25 22:59:52 +0300 |
commit | 6078fec593afcef1f2bb920b931daada09480f51 (patch) | |
tree | c7ed245478eb9f38cd90b504b18bdb48b8996387 /scripts | |
parent | 16ef822d9c5a07e9efc35cc3c28c05b737777b5a (diff) | |
download | gradecoin-6078fec593afcef1f2bb920b931daada09480f51.tar.gz gradecoin-6078fec593afcef1f2bb920b931daada09480f51.tar.bz2 gradecoin-6078fec593afcef1f2bb920b931daada09480f51.zip |
Fix testsreal
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/encryptor.py | 8 |
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 | ||
14 | iv = hex2bin("6e657665726d696e647468656e66756b") | 14 | iv = hex2bin("6e657665726d696e647468656e66756b") |
15 | |||
16 | iv_ready = base64.b64encode(iv) | ||
17 | |||
15 | key = hex2bin("6e6565726d666e646e6565726d666e64") | 18 | key = hex2bin("6e6565726d666e646e6565726d666e64") |
16 | 19 | ||
17 | mode = CBC(iv) | 20 | mode = CBC(iv) |
@@ -67,3 +70,8 @@ asy_cipher = PKCS1_OAEP.new(publickey, hashAlgo=Crypto.Hash.SHA256) | |||
67 | ciphertext = asy_cipher.encrypt(key) | 70 | ciphertext = asy_cipher.encrypt(key) |
68 | 71 | ||
69 | key = base64.b64encode(ciphertext) | 72 | key = base64.b64encode(ciphertext) |
73 | |||
74 | print(f'key: {key}') | ||
75 | print(f'c: {c}') | ||
76 | print(f'iv: {iv_ready}') | ||
77 | |||