-
Notifications
You must be signed in to change notification settings - Fork 31
Home
The virgil program is a command line tool for using Virgil Security stack functionality:
- encrypt, decrypt, sign and verify data;
- interact with Virgil Keys Service;
- interact with Virgil Private Keys Service.
Let's create two users Alice and Bob and demonstrate the communication between them.
mkdir alice
mkdir bob
Scenario for Alice is shown below, particularly Generate Keys and Create a Virgil Card. The same actions are performed for Bob.
-
Generate default Private Key(Elliptic 384-bits NIST Curve). You will be asked to enter the Private key password:
virgil keygen -o alice/private.key
-
Extracted a Public Key from the Private Key
virgil key2pub -i alice/private.key -o alice/public.key
Create a Virgil Card
-
Create a Global Virgil Card:
virgil card-create-global -d alice@domain.com --public-key alice/public.key -k alice/private.key -o alice/alice.vcard
-
Encrypt. Bob encrypts plain.txt for Alice. Bob needs Alice Gli Card to encrypt some data for Alice. He can get it from the Public Keys Service by indicating Alice email. Encrypt data for Alice identified by email:
virgil encrypt -i plain.txt -o plain.txt.enc email:alice@domain.com
-
Decrypt. Alice decrypts plain.txt.enc with here Private key and here Card. Alice decrypts the data on his side:
virgil decrypt -i plain.txt.enc -k alice/private.key -r vcard:alice/alice.vcard
-
Sign. Private Key is required in order to make a signature. Alice signs data:
virgil sign -i plain.txt -o plain.txt.sign -k alice/private.key
-
Verify. Bob verifies Alice's signature. He must have Alice's Global Virgil Card to verify the signature.
mkdir alice-domain virgil card-search-global -e alice@domain.com -o alice-domain/ virgil verify -i plain.txt -s plain.txt.sign -r vcard:alice-domain/alice.vcard
-
Encrypt. Alice encrypts plain.txt for Bob. Alice must have Bob's Public key + recipient's identifier in order to encrypt the data for Bob. pubkey is an argument, which contains Public Key and recipient's identifier. recipient's identifier is a plain text, which is needed for the Public key association. Encrypt data for Bob:
virgil encrypt -i plain.txt -o plain.txt.enc pubkey:bob/public.key:ForBob
-
Decrypt. Bob decrypts plain.txt.enc using his Private Key and recipient's identifier, which has been provided by Alice. Bob decrypts the data on his side:
virgil decrypt -i plain.txt.enc -k bob/private.key -r id:ForBob
-
Sign. Alice signs the data:
virgil sign -i plain.txt -o plain.txt.sign -k alice/private.key
-
Verify. Bob verifies Alice's signature. He must have Alice's Public key to verify the signature.
virgil verify -i plain.txt -s plain.txt.sign -r pubkey:alice/public.key
- CMake (accessible in command prompt). Minimum version: 3.2.
- Git (accessible in command prompt).
- libcurl + SSL
For Ubuntu (package libcurl4-openssl-dev):
apt-get -y install git build-essential libcurl4-openssl-dev
For Mac OS X:
brew install curl --with-openssl
-
Open terminal
-
Clone project
git clone https://github.com/VirgilSecurity/virgil-cli.git
-
Go to the project's folder.
cd virgil-cli
-
Checkout specific branch if needed.
-
Create folder for the build purposes and go to it
mkdir build && cd build
-
Configure, build and install
cmake .. && make && make install
-
Check installation
virgil --version
- Visual Studio 2015
- CMake (accessible in command prompt). Minimum version: 3.2.
- Git (accessible in command prompt).
- NSIS.
-
Open
Visual Studio Command Prompt
-
Clone project
git clone https://github.com/VirgilSecurity/virgil-cli.git
-
Go to the project's folder.
cd virgil-cli
-
Checkout specific branch if needed.
-
Create folder for the build purposes and go to it
mkdir build cd build
-
Configure, build and make installer
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release .. nmake nmake package
-
Check installer under
build
directorydir /B | findstr /R /C:"virgil-cli-*"
BSD 3-Clause. See LICENSE for details.
Email: support@virgilsecurity.com