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 with Virgil Security. You will encrypt data using a Public Key, which is saved on 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 .... Once encrypted, only the owner of the related Private Key will be able to decrypt the encrypted data. Therefore, you need to search for a 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 Card.
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:
- Bob's Virgil Cards, which should be published on Virgil ServicesVirgil Services is a group of cryptographic services that make up the Virgil Security infrastructure more ....
Do not forget that Bob can have a Global Virgil CardGlobal Cards are created with a unique validation token received after verification through the Virgil Identity Service more ... as well as an Application Virgil Card. If Alice is not a user of a specific Application, she will only be able to find Bob's Global Virgil Cards.
Let's review the data encryption process:
- Developers need to initialize the Virgil SDKThe SDK helps take tedious complexity out of coding by providing APIs for all of Virgil Services.
VirgilApi virgil = new VirgilApiImpl("[YOUR_ACCESS_TOKEN_HERE]");
- Then Alice:
- Searches for Bob's Virgil Card on Virgil Services
- Prepares the message for Bob
- Encrypts the message for Bob
// search for Virgil Cards
VirgilCards bobCards = virgil.getCards().find("bob");
String message = "Hey Bob, how's it going?";
// encrypt the message using found Virgil Cards
String ciphertext = bobCards.encrypt(message).toString(StringEncoding.Base64);
Alice can now send the encrypted message to Bob.