July 2017
Beginner to intermediate
358 pages
10h 54m
English
When we need to send an encrypted message, one of the best ways to do this is with asymmetric encryption, where we encrypt the message with publicly-known information that can be easily distributed and then decrypt it with the private key, which is securely held by a single party.
The crypto packages in Go have all the features we need to secure our data. If we take a look at the example in chapter8/asymmetric/asymmetric.go, the EncryptDataWithPublicKey method is a simple implementation of the rsa package's public key encryption:
func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, label []byte) ([]byte, error)
The first parameter is a cryptographic hash that is used as the random oracle to process ...
Read now
Unlock full access