jjzjj

EncryptOAEP

全部标签

encryption - 为什么 crypto/rsa 库中的 Go 函数 EncryptOAEP 需要一个随机的 io.Reader?

我正在编写一个文件服务器,它在客户端加密数据,通过TCP发送数据,并在服务器端使用非对称RSA-OAEP加密对其进行解密。我一直在尝试使用两个主要函数,它们根据documentation采用以下参数:EncryptOAEP(hashhash.Hash,randomio.Reader,pub*PublicKey,msg[]byte,label[]byte)(out[]byte,errerror)DecryptOAEP(hashhash.Hash,randomio.Reader,priv*PrivateKey,ciphertext[]byte,label[]byte)(msg[]byte,

encryption - 为什么 crypto/rsa 库中的 Go 函数 EncryptOAEP 需要一个随机的 io.Reader?

我正在编写一个文件服务器,它在客户端加密数据,通过TCP发送数据,并在服务器端使用非对称RSA-OAEP加密对其进行解密。我一直在尝试使用两个主要函数,它们根据documentation采用以下参数:EncryptOAEP(hashhash.Hash,randomio.Reader,pub*PublicKey,msg[]byte,label[]byte)(out[]byte,errerror)DecryptOAEP(hashhash.Hash,randomio.Reader,priv*PrivateKey,ciphertext[]byte,label[]byte)(msg[]byte,