【Write Up】Times

19011343447 2025-08-21 22:28:20 47 0 返回题目详情


import sys
sys.path.append(r'D:\3-Studies\3-CTF\Crypto_Tools')

from Elliptic_Curve_Cryptography import *
E = ECC(13, 245, 335135809459196851603485825030548860907)
start_point = (14592775108451646097, 237729200841118959448447480561827799984)
new_point = E.scalar_multiply(start_point, 1337)

# get AES key from shared secret
import hashlib
sha1 = hashlib.sha1()
sha1.update(str(new_point[0]).encode('ascii'))
key = sha1.digest()[:16]

aes = {'ciphertext': b'SllGMo5gxalFG9g8j4KO0cIbXeub0CM2VAWzXo3nbIxMqy1Hl4f+dGwhM9sm793NikYA0EjxvFyRMcU2tKj54Q==', 'iv': b'MWkMvRmhFy2vAO9Be9Depw=='}
from base64 import b64decode
ciphertext = b64decode(aes['ciphertext'])
iv = b64decode(aes['iv'])

from Cryptodome.Cipher import AES
cipher = AES.new(key, AES.MODE_CBC, iv)
plaintext = cipher.decrypt(ciphertext)

from Cryptodome.Util.Padding import unpad
plaintext = unpad(plaintext, AES.block_size)

print(plaintext.decode('ascii'))

一步步模拟这个过程做就行了。

分类:Crypto
image
作者:19011343447

18

提交

0

收入

相关WriteUP

问题反馈