Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptPKCS1v15 ¶
DecryptPKCS1v15 decrypts a plaintext using RSA and the padding scheme from PKCS#1 v1.5. If rand != nil, it uses RSA blinding to avoid timing side-channel attacks.
Note that whether this function returns an error or not discloses secret information. If an attacker can cause this function to run repeatedly and learn whether each instance returned an error then they can decrypt and forge signatures as if they had the private key. See DecryptPKCS1v15SessionKey for a way of solving this problem.
Originally from https://golang.org/src/crypto/rsa/pkcs1v15.go?s=2396:2485#L66
func EncryptPKCS1v15 ¶
EncryptPKCS1v15 encrypts the given message with RSA and the padding scheme from PKCS#1 v1.5. The message must be no longer than the length of the public modulus minus 11 bytes.
The rand parameter is used as a source of entropy to ensure that encrypting the same message twice doesn't result in the same ciphertext.
WARNING: use of this function to encrypt plaintexts other than session keys is dangerous. Use RSA OAEP in new protocols.
Originally from https://github.com/golang/go/blob/release-branch.go1.14/src/crypto/rsa/pkcs1v15.go#L29-L66
Types ¶
This section is empty.