|
楼主 |
发表于 2024-3-11 00:01:29
|
显示全部楼层
广西壮族自治区南宁市
import nacl.signing
import base58
import time
# 将Base58编码的私钥解码
private_key_base58 = "4ZV2GJL4ygNt5uYHG3G6Ya5sBoi6QRAoBQ5APxgfc4Qow8vQN8nU51aTp8APgM6DzEwr8Ya2f6TcP1wmn9Zbe6c"
private_key_bytes = base58.b58decode(private_key_base58)
# 获取种子
seed = private_key_bytes[:32]
t= time.time()
# 创建签名密钥对象
signing_key = nacl.signing.SigningKey(seed)
# 签名内容
message = f"sign in{int(t)}"
signed_message = signing_key.sign(message.encode())
# 输出签名结果
print("Signed message:", signed_message.signature.hex()) |
|