End-to-end encryption with multiple device support powered by Virgil Security
> E3Kit's underlying crypto library is compiled to WebAssembly. You need to make sure your target browsers support WebAssembly. We also have asm.js fallback for environments that don't support WebAssembly. The downside of it is much slower download and execution time.
sh
npm install @virgilsecurity/e3kit-browser
`
- yarn:
`sh
yarn add @virgilsecurity/e3kit-browser
`
- UMD: WebAssembly
`html
` asm.js (Use this only if your target environments don't support WebAssembly)
`html
`Use
- npm: WebAssembly
`javascript
import { EThree } from '@virgilsecurity/e3kit-browser'; // Promise
EThree.initialize(tokenCallback)
.then(eThree => {
// register user, encrypt, decrypt, etc.
});
// async/await
const eThree = await EThree.initialize(tokenCallback);
// register user, encrypt, decrypt, etc.
` asm.js (Use this only if your target environments don't support WebAssembly)
`javascript
import { EThree } from '@virgilsecurity/e3kit-browser/dist/browser.asmjs.es'; // Promise
EThree.initialize(tokenCallback)
.then(eThree => {
// register user, encrypt, decrypt, etc.
});
// async/await
const eThree = await EThree.initialize(tokenCallback);
// register user, encrypt, decrypt, etc.
`- UMD:
`html
`Encrypt & decrypt large files
See the following methods if you need to encrypt & decrypt large files with the best speed/browser performance ratio:
- authEncryptFile
- authDecryptFile
Both methods take an instance of
File class as input instead of binary ArrayBuffer.
The files are encrypted in small chunks, so it doesn't block the main thread and it returns an encrypted instance of File`. The chunk size by default is 64kb which produces the best speed/browser performance ratio, but it can be changed. Larger chunk size speeds up encryption but can cause browser lags.The code sample can be found here.
> This approach for file encryption is currently only supported in browser environments and mobile apps built with the Ionic framework.
You can find us on Twitter or send us email support@VirgilSecurity.com.
Also, get extra help from our support team on Slack.