Introduction
SelfGuard provides encryption APIs and tooling to allow web2/3 developers to build enhanced and secure UI/UX.
Get Started
Installation
SelfGuard can either be instantiated in the browser or server.
There are also react components to automatically integrate SelfGuard’s Modules (i.e - Enable/Disabling User Notifications)
Browser
Server
React Components
Import
Depending on the environment, SelfGuard can be imported in the following ways.
Browser
Server
React Components
Instantiation
There are three main ways to instantiate SelfGuard.
Without Asymmetric Encryption
This instantiates SelfGuard such that data with SelfGuard can be decrypted with this API-KEY.
ecdsa
key pair, it will automatically store the encryption keys with Lit Protocol such that only the owner of the metamask account will be able to access them.With Asymmetric Encryption (Key Pair)
This instantiates SelfGuard such that data encrypted with SelfGuard can only be decrypted by the user with the respective public/private key pair.
The key pair type that can either be ecdsa
or rsa
The public key of the user, which can be generated using sg.createKeyPair('rsa' || 'ecdsa')
;
The private key of the user, which can be generated using sg.createKeyPair('rsa' || 'ecdsa')
;
With Asymmetric Encryption (Metamask)
This instantiates SelfGuard such that data encrypted with SelfGuard can only be decrypted by the end user’s metamask’s account.