gpt4 book ai didi

encryption - 用公钥解密

转载 作者:数据小太阳 更新时间:2023-10-29 03:47:28 27 4
gpt4 key购买 nike

<分区>

如何在 golang 中解密使用私钥签名的消息?

$ openssl genrsa -out ./server/server.key
Generating RSA private key, 2048 bit long modulus
..................+++
.............................................+++

$ openssl rsa -in ./server/server.key -pubout -out ./client/client.pub
writing RSA key

$ echo "secret" | openssl rsautl -inkey ./server/server.key -sign > ./secret

# decrypt with public key
$ openssl rsautl -inkey ./client/client.pub -pubin -in ./secret
secret

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com