|
楼主 |
发表于 2022-2-15 14:09:31
|
显示全部楼层
四川省成都市
import OpenSSL.crypto, binascii, os, time
der =binascii.unhexlify("024100EF94C054E9D39E38FF5A8E710D15296BBF3351D27BA015EA0699FABAB380B3CF642D51DF5B68AA817C4052749B24C055478316C50350DCEE216EAC9928404785024100DF68FD89B495AF2C4BBD65199E028DC28DB113EC1C60301854132C602DCE054DC55E1564143D3A6559C9B18FF86DDD9575023E6C8D8A57DF5A1EEB4C246D9663024004C9F6663C1E4CC55AE5567F900162489313D588DD8BBFA463E96407A35AE93D360569E38B1236864C1385126B9F7A70B9F336DB4D4BAA7EE01034470374F579024100A646D515C")
private_key = OpenSSL.crypto.load_privatekey(OpenSSL.crypto.FILETYPE_ASN1, der)
print("\nGenerated SWaP is: " + (data + "".join(format(x, '02x') for x in OpenSSL.crypto.sign(private_key, binascii.unhexlify(data), 'ripemd160'))).upper()) |
|