Socket
Socket
Sign inDemoInstall

@toruslabs/eccrypto

Package Overview
Dependencies
Maintainers
5
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toruslabs/eccrypto - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

14

dist/eccrypto.cjs.js

@@ -109,3 +109,3 @@ /******/ (() => { // webpackBootstrap

return async function (iv, key, data) {
if (subtle) {
if (subtle && subtle[op] && subtle.importKey) {
const importAlgorithm = {

@@ -119,4 +119,16 @@ name: "AES-CBC"

};
// encrypt and decrypt ops are not implemented in react-native-quick-crypto yet.
const result = await subtle[op](encAlgorithm, cryptoKey, data);
return Buffer.from(new Uint8Array(result));
} else if (op === "encrypt" && browserCrypto.createCipheriv) {
// This is available if crypto is polyfilled in react native environment
const cipher = browserCrypto.createCipheriv("aes-256-cbc", key, iv);
const firstChunk = cipher.update(data);
const secondChunk = cipher.final();
return Buffer.concat([firstChunk, secondChunk]);
} else if (op === "decrypt" && browserCrypto.createDecipheriv) {
const decipher = browserCrypto.createDecipheriv("aes-256-cbc", key, iv);
const firstChunk = decipher.update(data);
const secondChunk = decipher.final();
return Buffer.concat([firstChunk, secondChunk]);
}

@@ -123,0 +135,0 @@ throw new Error(`Unsupported operation: ${op}`);

@@ -54,3 +54,3 @@ import { ec as ec$1 } from 'elliptic';

return async function (iv, key, data) {
if (subtle) {
if (subtle && subtle[op] && subtle.importKey) {
const importAlgorithm = {

@@ -64,4 +64,16 @@ name: "AES-CBC"

};
// encrypt and decrypt ops are not implemented in react-native-quick-crypto yet.
const result = await subtle[op](encAlgorithm, cryptoKey, data);
return Buffer.from(new Uint8Array(result));
} else if (op === "encrypt" && browserCrypto.createCipheriv) {
// This is available if crypto is polyfilled in react native environment
const cipher = browserCrypto.createCipheriv("aes-256-cbc", key, iv);
const firstChunk = cipher.update(data);
const secondChunk = cipher.final();
return Buffer.concat([firstChunk, secondChunk]);
} else if (op === "decrypt" && browserCrypto.createDecipheriv) {
const decipher = browserCrypto.createDecipheriv("aes-256-cbc", key, iv);
const firstChunk = decipher.update(data);
const secondChunk = decipher.final();
return Buffer.concat([firstChunk, secondChunk]);
}

@@ -68,0 +80,0 @@ throw new Error(`Unsupported operation: ${op}`);

@@ -56,3 +56,3 @@ 'use strict';

return async function (iv, key, data) {
if (subtle) {
if (subtle && subtle[op] && subtle.importKey) {
const importAlgorithm = {

@@ -66,4 +66,16 @@ name: "AES-CBC"

};
// encrypt and decrypt ops are not implemented in react-native-quick-crypto yet.
const result = await subtle[op](encAlgorithm, cryptoKey, data);
return Buffer.from(new Uint8Array(result));
} else if (op === "encrypt" && browserCrypto.createCipheriv) {
// This is available if crypto is polyfilled in react native environment
const cipher = browserCrypto.createCipheriv("aes-256-cbc", key, iv);
const firstChunk = cipher.update(data);
const secondChunk = cipher.final();
return Buffer.concat([firstChunk, secondChunk]);
} else if (op === "decrypt" && browserCrypto.createDecipheriv) {
const decipher = browserCrypto.createDecipheriv("aes-256-cbc", key, iv);
const firstChunk = decipher.update(data);
const secondChunk = decipher.final();
return Buffer.concat([firstChunk, secondChunk]);
}

@@ -70,0 +82,0 @@ throw new Error(`Unsupported operation: ${op}`);

@@ -54,3 +54,3 @@ import { ec as ec$1 } from 'elliptic';

return async function (iv, key, data) {
if (subtle) {
if (subtle && subtle[op] && subtle.importKey) {
const importAlgorithm = {

@@ -64,4 +64,16 @@ name: "AES-CBC"

};
// encrypt and decrypt ops are not implemented in react-native-quick-crypto yet.
const result = await subtle[op](encAlgorithm, cryptoKey, data);
return Buffer.from(new Uint8Array(result));
} else if (op === "encrypt" && browserCrypto.createCipheriv) {
// This is available if crypto is polyfilled in react native environment
const cipher = browserCrypto.createCipheriv("aes-256-cbc", key, iv);
const firstChunk = cipher.update(data);
const secondChunk = cipher.final();
return Buffer.concat([firstChunk, secondChunk]);
} else if (op === "decrypt" && browserCrypto.createDecipheriv) {
const decipher = browserCrypto.createDecipheriv("aes-256-cbc", key, iv);
const firstChunk = decipher.update(data);
const secondChunk = decipher.final();
return Buffer.concat([firstChunk, secondChunk]);
}

@@ -68,0 +80,0 @@ throw new Error(`Unsupported operation: ${op}`);

2

package.json
{
"name": "@toruslabs/eccrypto",
"version": "5.0.1",
"version": "5.0.2",
"description": "JavaScript Elliptic curve cryptography library, includes fix to browser.js so that encrypt/decrypt works",

@@ -5,0 +5,0 @@ "main": "./dist/lib.cjs/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc