Encrypting for multiple recipients
This guide is a short tutorial on how to encryptEncryption is the process of encoding a message or information in such a way, that only authorized parties can access it more ... data for multiple recipients with Virgil Security. You will encrypt data with a Public Key, which is saved in the user's Virgil CardEach Card contains attributes associated with the holder of the Private key and are used to prove the ownership of a Public key more .... This means that only the owner of the related Private Key will be able to decrypt the encrypted data. Therefore, you need to search for the user's Virgil Cards at Virgil ServicesVirgil Services is a group of cryptographic services that make up the Virgil Security infrastructure more ... and then encrypt the data using the appropiate Virgil Cards.
Encryption can be used to provide high levels of security to network communications, e-mails, files stored on the cloud, and other information that requires protection.
For original information about encryption, its syntax and parameters, follow the link here.
Set up your project environment before you begin to encrypt data, with the getting started guide.
The Data Encryption procedure is shown in the figure below.
In order to encrypt a message, Alice has to have:
- The participants' Virgil Cards, which should be published on Virgil Services.
Let's review data encryption for multiple recipients:
- Developers need to initialize the Virgil SDKThe SDK helps take tedious complexity out of coding by providing APIs for all of Virgil Services.
api, err := virgilapi.New("[YOUR_ACCESS_TOKEN_HERE]")
- Then Alice:
- Searches for participants' Virgil Cards on Virgil Services
- Prepares the message
- Encrypts the message
// search for Cards
bobCards, err := api.Cards.Find("bob")
// message for encryption
message := "Hey Bob, how's it going?"
// encrypt the message
ciphertextBuf, err := bobCards.EncryptString(message)
ciphertext := ciphertextBuf.ToBase64String()
Alice can now send the encrypted message to the recipients.
In many cases you will need the receiver's Virgil Cards. See Finding Cards guide to find them.