Encryption is different from hashing because it is reversible and the original message can be recovered. There are symmetric encryption methods that use a password or a shared key to encrypt and decrypt. There are also asymmetric encryption algorithms that operate with a public and private key pair. AES is an example of symmetric encryption, and it is used to encrypt ZIP files, PDF files, or an entire filesystem. RSA is an example of asymmetric encryption and is used for SSL, SSH keys, and PGP.
Encryption
Cryptographically secure pseudo-random number generator (CSPRNG)
The math and rand packages do not provide the same amount of randomness that the crypto/rand package offers. Do not use math/rand for cryptographic applications...