Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@virgilsecurity/e3kit-browser

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@virgilsecurity/e3kit-browser

End-to-end encryption with multiple device support powered by Virgil Security

latest
Source
npmnpm
Version
3.0.6
Version published
Weekly downloads
306
-27.49%
Maintainers
3
Weekly downloads
 
Created
Source

Virgil E3Kit SDK for Browsers

Virgil E3Kit SDK is also available on other platforms:

  • Node.js
  • React Native

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.

Install

  • npm:

    npm install @virgilsecurity/e3kit-browser
    
  • yarn:

    yarn add @virgilsecurity/e3kit-browser
    
  • UMD:

    WebAssembly

    <script type="text/javascript" src="https://unpkg.com/@virgilsecurity/e3kit-browser@^2.1.0/dist/browser.umd.js"></script>
    

    asm.js (Use this only if your target environments don't support WebAssembly)

    <script type="text/javascript" src="https://unpkg.com/@virgilsecurity/e3kit-browser@^2.1.0/dist/browser.asmjs.umd.js"></script>
    

Use

  • npm:

    WebAssembly

    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)

    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:

    <script type="text/javascript">
        const EThree = window.E3kit.EThree;
    
        // Promise
        EThree.initialize(tokenCallback)
            .then(eThree => {
                // register user, encrypt, decrypt, etc.
            });
    
        // async/await
        const eThree = await EThree.initialize(tokenCallback);
        // register user, encrypt, decrypt, etc.
    </script>
    

Encrypt & decrypt large files

See the following methods if you need to encrypt & decrypt large files with the best speed/browser performance ratio:

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.

Further reading

You can find detailed guides on library usage here.

License

This library is released under the 3-clause BSD License.

Support

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

Package last updated on 28 May 2024

Did you know?

Socket

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.

Install

Related posts