Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neoskop/ethereal-secrets-client

Package Overview
Dependencies
Maintainers
2
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neoskop/ethereal-secrets-client - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

1

dist/index.d.ts

@@ -20,2 +20,3 @@ export interface EtherealSecretsClientConfig {

constructor(config: EtherealSecretsClientConfig);
private fromBase64;
private toBase64;

@@ -22,0 +23,0 @@ private decrypt;

31

dist/index.js

@@ -19,4 +19,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
fromBase64(data) {
return new Uint8Array(window
.atob(data)
.split('')
.map(function (c) {
return c.charCodeAt(0);
}));
}
toBase64(data) {
return Buffer.from(data).toString('base64');
const chunkSize = 0x1000;
const chunks = [];
for (let i = 0; i < data.length; i += chunkSize) {
chunks.push(String.fromCharCode.apply(null, data.subarray(i, i + chunkSize)));
}
return window.btoa(chunks.join(''));
}

@@ -26,6 +39,6 @@ decrypt(secret, cipherText) {

const encryptedObj = JSON.parse(cipherText);
const iv = Buffer.from(encryptedObj.iv, 'base64');
const salt = Buffer.from(encryptedObj.salt, 'base64');
const data = Buffer.from(encryptedObj.encrypted, 'base64');
const additionalData = Buffer.from(encryptedObj.additionalData, 'base64');
const iv = this.fromBase64(encryptedObj.iv);
const salt = this.fromBase64(encryptedObj.salt);
const data = this.fromBase64(encryptedObj.encrypted);
const additionalData = this.fromBase64(encryptedObj.additionalData);
const key = yield this.deriveKey(secret, salt);

@@ -55,6 +68,6 @@ const clearText = yield window.crypto.subtle.decrypt({

return JSON.stringify({
encrypted: Buffer.from(new Uint8Array(encrypted)).toString('base64'),
salt: Buffer.from(salt).toString('base64'),
iv: Buffer.from(iv).toString('base64'),
additionalData: Buffer.from(additionalData).toString('base64'),
encrypted: this.toBase64(new Uint8Array(encrypted)),
salt: this.toBase64(salt),
iv: this.toBase64(iv),
additionalData: this.toBase64(additionalData),
});

@@ -61,0 +74,0 @@ });

{
"name": "@neoskop/ethereal-secrets-client",
"version": "4.0.2",
"version": "4.0.3",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "typings": "dist/index.d.ts",

Sorry, the diff of this file is not supported yet

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