Examples using... "crypto/rand"
Recent
SignPKCS1v15 calculates the signature of hashed using
RSASSA-PKCS1-V1_5-SIGN from RSA PKCS#1 v1.5. Note that hashed must
be the result of hashing the input message using the given hash
function. If hash is zero, hashed is signed directly. This isn't
advisable except for interoperability.
EncryptOAEP encrypts the given message with RSA-OAEP.
DecryptPKCS1v15SessionKey decrypts a session key using RSA and the padding scheme from PKCS#1 v1.5.
If rand != nil, it uses RSA blinding to avoid timing side-channel attacks.
It returns an error if the ciphertext is the wrong length or if the
ciphertext is greater than the public modulus. Otherwise,...
DecryptOAEP decrypts ciphertext using RSA-OAEP.
This example reads 10 cryptographically secure pseudorandom numbers from
rand.Reader and writes them to a byte slice.
Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as
defined in FIPS 186-3.
NewOFB returns a Stream that encrypts or decrypts using the block cipher b
in output feedback mode. The initialization vector iv's length must be equal
to b's block size.
NewGCM returns the given 128-bit, block cipher wrapped in Galois Counter Mode
with the standard nonce length.
NewCTR returns a Stream which encrypts/decrypts using the given Block in
counter mode. The length of iv must be the same as the Block's block size.
NewCFBEncrypter returns a Stream which encrypts with cipher feedback mode,
using the given Block. The iv must be the same length as the Block's block
size.
NewCBCEncrypter returns a BlockMode which encrypts in cipher block chaining
mode, using the given Block. The length of iv must be the same as the
Block's block size.