
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
@virgilsecurity/keyknox
Advanced tools
Keyknox SDK allows developers to communicate with Virgil Keyknox Service to upload, download, and synchronize encrypted sensitive data (private keys) between different devices.
This README is for Keyknox v0.3.x. Check the v0.2.x branch for Keyknox v0.2.x docs.
Introduction | SDK Features | Installation | Usage Example | Docs | Support
Virgil Security provides an SDK which allows you to communicate with Virgil Keyknox Service.
Virgil Keyknox Service allows users to store their sensitive data (such as Private Key) encrypted (with end-to-end encryption) for using and sharing it between different devices.
You can install this module from npm. Another option is to add it via script
tag in browser.
You will need to install @virgilsecurity/keyknox
.
npm install @virgilsecurity/keyknox@0.3.2
You will also need to install virgil-crypto
and virgil-sdk
from npm.
npm install virgil-crypto@4.0.0-alpha.13 virgil-sdk@6.0.0-alpha.4
script
tagYou will need to add @virgilsecurity/keyknox
script.
<script src="https://unpkg.com/@virgilsecurity/keyknox@0.3.2/dist/keyknox.umd.js"></script>
You will also need to add virgil-crypto
and virgil-sdk
scripts.
<script src="https://unpkg.com/virgil-crypto@4.0.0-alpha.13/dist/browser.umd.js"></script>
<script src="https://unpkg.com/virgil-sdk@6.0.0-alpha.4/dist/virgil-sdk.browser.umd.js"></script>
Now you can use global variables Keyknox
, Virgil
and VirgilCrypto
as namespace objects, containing all of @virgilsecurity/keyknox
, virgil-sdk
and virgil-crypto
exports as properties.
To begin using Virgil Keyknox SDK you'll need to initialize SyncKeyStorage
class. This class is responsible for synchronization between device storage - IndexedDB in a browser or file system in Node.js - and Keyknox Cloud. In order to initialize SyncKeyStorage
class you'll need the following values:
identity
of the useraccessTokenProvider
to provide access token for Virgil serviceskeyEntryStorage
to store data locallyprivateKey
of current device/userpublicKeys
of all devices/users that should have access to datavirgilCrypto
to perform all cryptographic operationsconst { SyncKeyStorage } = require('@virgilsecurity/keyknox');
const { initCrypto, VirgilCrypto } = require('virgil-crypto');
initCrypto().then(() => {
// Identity of the user
const identity = ...;
// Setup Access Token provider to provide access token for Virgil services
// Check https://github.com/VirgilSecurity/virgil-sdk-javascript
const accessTokenProvider = ...;
// Setup Key Entry Storage to store data locally
// Check https://github.com/VirgilSecurity/virgil-sdk-javascript
const keyEntryStorage = ...;
// Public keys of users that should have access to data
const publicKeys = ...;
// Private key of current user
const privateKey = ...;
// An instance of `VirgilCrypto` class
const virgilCrypto = new VirgilCrypto();
const syncKeyStorage = SyncKeyStorage.create({
identity,
accessTokenProvider,
keyEntryStorage,
privateKey,
publicKeys,
virgilCrypto,
});
});
You can find a complete example of simple client-server application here.
If you lost your private key, you are not able to decrypt saved data anymore. So you need to reset your stored data in the Virgil Keyknox Service and start over.
import { KeyknoxClient } from '@virgilsecurity/keyknox';
const tokenPromise = accessTokenProvider.getToken({ operation: 'delete' });
const resetPromise = tokenPromise.then(token => new KeyknoxClient().resetValue(token.toString()));
const syncKeyStorage = SyncKeyStorage.create(...);
resetPromise.then(() => syncKeyStorage.sync());
Virgil Security has a powerful set of APIs, and the documentation below can get you started today.
This library is released under the BSD 3-Clause License.
Our developer support team is here to help you. Find out more information on our Help Center.
You can find us on Twitter or send us email support@VirgilSecurity.com.
Also, get extra help from our support team on Slack.
FAQs
Keyknox SDK allows developers to communicate with Virgil Keyknox Service to upload, download, and synchronize encrypted sensitive data (private keys) between different devices.
The npm package @virgilsecurity/keyknox receives a total of 1,113 weekly downloads. As such, @virgilsecurity/keyknox popularity was classified as popular.
We found that @virgilsecurity/keyknox demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.