aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/encryptor.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/scripts/encryptor.py b/scripts/encryptor.py
index 008ac51..2dac487 100644
--- a/scripts/encryptor.py
+++ b/scripts/encryptor.py
@@ -20,16 +20,28 @@ cipher = Cipher(algorithms.AES(key), mode)
20 20
21encryptor = cipher.encryptor() 21encryptor = cipher.encryptor()
22 22
23padder = padding.PKCS7(128).padder()
24 23
25payload_string = """{"public_key":"-----BEGIN PUBLIC KEY-----\\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzJN9ALFoUHE8SigFhtql 24payload = dict()
26\\n+GPI6dIVHDCfAFXe6DU131yXoL14imBRBb5SevMou5WGiL7XBTdtlRaY8+dkNdFz\\nWEMhPoe++/GvV3u6Mq6UAJMjuiJj838NbJVl+83+NEP66htXpqidTIdr 25payload["public_key"] = """-----BEGIN PUBLIC KEY-----
277syaRU1T\\n0PfgvVYdNkwiWkTVtwveRchGtUwp2iZePMSF1+vtKKDvzXgZuwrKBhwBFXz6ApSZ\\n+eGkWhK1pW6TRTSENlySwb/DEg5PckzOzApLTTQqi4uu+sHU 26MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoNsLhsQzL+5HiGuaI4mu
28D+McAtOP9pNILwst\\nG87LxNEO0roFqUaDIhRolgkF8jol2BUZmKChdy84XX+L6jpqDvPsxuTUpIghr0Jq\\nvQIDAQAB\\n-----END PUBLIC KEY-----","st 27K0TqiLEOFPOl8kd9pWR8eop0b7/N2ggDRXATIkV+XwzeQp+k9lGT1h2B2bDhxn51
29udent_id":"e223795","passwd":"pmcTCKox99NFsqp"}""" 28lBESb2rSqKKzTVf4SXoPxqvPwsi1bnmHcRG8tTr+ZWcJdblXabMUkKUJCrwKhvr8
29UpOi0tndcc7buVq4EWCIBUeG4SCFHeBu1Ue9Zus7BpwjSxF4jHH4M8ssl/ioN8+m
30qz9LcDQe3kvVRMlVbaXjYnWyP0VjwRbQuwIjMsDVaTQUIVtPZY9el7LiIxCqZ4mO
31cnnwlIZyGLN52uqDZ1cz7aSO18YIGcbCpxuOuPhSzrnZNvHJZFIkacd477fK+PKB
327QIDAQAB
33-----END PUBLIC KEY-----"""
34payload["student_id"] = "e223795"
35payload["passwd"] = "pmcTCKox99NFsqp"
36
37import json
38payload_string = json.dumps(payload)
30 39
31byte_guys = str.encode(payload_string) 40byte_guys = str.encode(payload_string)
41
42padder = padding.PKCS7(128).padder()
32padded_data = padder.update(byte_guys) 43padded_data = padder.update(byte_guys)
44padded_data += padder.finalize()
33 45
34ct = encryptor.update(padded_data) + encryptor.finalize() 46ct = encryptor.update(padded_data) + encryptor.finalize()
35 47