🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@gotabit/crypto

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gotabit/crypto - npm Package Compare versions

Comparing version
0.1.1
to
0.1.2
+17
dist/micro-aes-gcm.d.ts
declare function hexToBytes(hex: string): Uint8Array;
declare function concatBytes(...arrays: Uint8Array[]): Uint8Array;
export declare function encrypt(sharedKey: Uint8Array, plaintext: string | Uint8Array): Promise<Uint8Array>;
export declare function decrypt(sharedKey: Uint8Array, encoded: string | Uint8Array): Promise<Uint8Array>;
export declare const utils: {
randomBytes: (bytesLength?: number) => any;
bytesToUtf8(bytes: Uint8Array): string;
utf8ToBytes(string: string): Uint8Array;
hexToBytes: typeof hexToBytes;
concatBytes: typeof concatBytes;
};
declare const aes: {
encrypt: typeof encrypt;
decrypt: typeof decrypt;
};
export default aes;
//# sourceMappingURL=micro-aes-gcm.d.ts.map
{"version":3,"file":"micro-aes-gcm.d.ts","sourceRoot":"","sources":["../src/micro-aes-gcm.ts"],"names":[],"mappings":"AAaA,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAgB3C;AAID,iBAAS,WAAW,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAYxD;AAID,wBAAsB,OAAO,CAC3B,SAAS,EAAE,UAAU,EACrB,SAAS,EAAE,MAAM,GAAG,UAAU,uBA8B/B;AAED,wBAAsB,OAAO,CAC3B,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,MAAM,GAAG,UAAU,uBA4B7B;AAKD,eAAO,MAAM,KAAK;;uBAWG,UAAU,GAAG,MAAM;wBAGlB,MAAM,GAAG,UAAU;;;CAKxC,CAAC;AAEF,QAAA,MAAM,GAAG;;;CAAuB,CAAC;AACjC,eAAe,GAAG,CAAC"}
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.utils = exports.decrypt = exports.encrypt = void 0;
const nodeCrypto = __importStar(require("crypto"));
const crypto = {
node: nodeCrypto,
web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined,
};
function hexToBytes(hex) {
if (typeof hex !== 'string') {
throw new TypeError(`hexToBytes: expected string, got ${typeof hex}`);
}
if (hex.length % 2)
throw new Error(`hexToBytes: received invalid unpadded hex${hex.length}`);
const array = new Uint8Array(hex.length / 2);
for (let i = 0; i < array.length; i++) {
const j = i * 2;
const hexByte = hex.slice(j, j + 2);
const byte = Number.parseInt(hexByte, 16);
if (Number.isNaN(byte) || byte < 0)
throw new Error('Invalid byte sequence');
array[i] = byte;
}
return array;
}
function concatBytes(...arrays) {
if (!arrays.every((arr) => arr instanceof Uint8Array))
throw new Error('Uint8Array list expected');
if (arrays.length === 1)
return arrays[0];
const length = arrays.reduce((a, arr) => a + arr.length, 0);
const result = new Uint8Array(length);
for (let i = 0, pad = 0; i < arrays.length; i++) {
const arr = arrays[i];
result.set(arr, pad);
pad += arr.length;
}
return result;
}
const MD = { e: 'AES-GCM', i: { name: 'AES-GCM', length: 256 } };
function encrypt(sharedKey, plaintext) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof plaintext === 'string')
plaintext = exports.utils.utf8ToBytes(plaintext);
const iv = exports.utils.randomBytes(12);
if (crypto.web) {
const iKey = yield crypto.web.subtle.importKey('raw', sharedKey, MD.i, true, ['encrypt']);
const cipher = yield crypto.web.subtle.encrypt({ name: MD.e, iv }, iKey, plaintext);
const ciphertext = new Uint8Array(cipher);
const encrypted = new Uint8Array(iv.length + ciphertext.byteLength);
encrypted.set(iv, 0);
encrypted.set(ciphertext, iv.length);
return encrypted;
}
const cipher = crypto.node.createCipheriv('aes-256-gcm', sharedKey, iv);
let ciphertext = cipher.update(plaintext, undefined, 'hex');
ciphertext += cipher.final('hex');
const ciphertextBytes = hexToBytes(ciphertext);
const tag = cipher.getAuthTag();
const encrypted = concatBytes(iv, ciphertextBytes, tag);
return encrypted;
});
}
exports.encrypt = encrypt;
function decrypt(sharedKey, encoded) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof encoded === 'string')
encoded = hexToBytes(encoded);
const iv = encoded.slice(0, 12);
if (crypto.web) {
const ciphertextWithTag = encoded.slice(12);
const iKey = yield crypto.web.subtle.importKey('raw', sharedKey, MD.i, true, ['decrypt']);
const plaintext = yield crypto.web.subtle.decrypt({ name: MD.e, iv }, iKey, ciphertextWithTag);
return new Uint8Array(plaintext);
}
const ciphertext = encoded.slice(12, -16);
const authTag = encoded.slice(-16);
const decipher = crypto.node.createDecipheriv('aes-256-gcm', sharedKey, iv);
decipher.setAuthTag(authTag);
const plaintext = decipher.update(ciphertext);
const final = Uint8Array.from(decipher.final());
const res = concatBytes(plaintext, final);
return res;
});
}
exports.decrypt = decrypt;
exports.utils = {
randomBytes: (bytesLength = 32) => {
if (crypto.web) {
return crypto.web.getRandomValues(new Uint8Array(bytesLength));
}
if (crypto.node) {
const { randomBytes } = crypto.node;
return Uint8Array.from(randomBytes(bytesLength));
}
throw new Error("The environment doesn't have randomBytes function");
},
bytesToUtf8(bytes) {
return new TextDecoder().decode(bytes);
},
utf8ToBytes(string) {
return new TextEncoder().encode(string);
},
hexToBytes,
concatBytes,
};
const aes = { encrypt, decrypt };
exports.default = aes;
//# sourceMappingURL=micro-aes-gcm.js.map
{"version":3,"file":"micro-aes-gcm.js","sourceRoot":"","sources":["../src/micro-aes-gcm.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,mDAAqC;AAIrC,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,OAAO,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;CAC5E,CAAC;AAGF,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,MAAM,IAAI,SAAS,CAAC,oCAAoC,OAAO,GAAG,EAAE,CAAC,CAAC;KACvE;IACD,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,4CAA4C,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,C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AQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7B,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC9C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;QAChD,MAAM,GAAG,GAAG,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC1C,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AA9BD,0BA8BC;AAKY,QAAA,KAAK,GAAG;IACnB,WAAW,EAAE,CAAC,WAAW,GAAG,EAAE,EAAE,EAAE;QAChC,IAAI,MAAM,CAAC,GAAG,EAAE;YACd,OAAO,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;SAChE;QACD,IAAI,MAAM,CAAC,IAAI,EAAE;YACf,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;YACpC,OAAO,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;SAClD;QACD,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,WAAW,CAAC,KAAiB;QAC3B,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IACD,WAAW,CAAC,MAAc;QACxB,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IACD,UAAU;IACV,WAAW;CACZ,CAAC;AAEF,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACjC,kBAAe,GAAG,CAAC"}
+5
-5

@@ -1,14 +0,14 @@

type PrivKey = Uint8Array | string | bigint | number;
type PubKey = Uint8Array | string;
declare type PrivKey = Uint8Array | string | bigint | number;
declare type PubKey = Uint8Array | string;
export declare const getEncryptParams: (privKey: PrivKey, pubKey: PubKey, method?: 'basic' | 'ecies') => Promise<{
encryptKey: string;
tmpPubKey?: undefined;
pubEncyprt?: undefined;
sourcePubkey?: undefined;
} | {
tmpPubKey: string;
encryptKey: string;
pubEncyprt?: undefined;
sourcePubkey?: undefined;
} | {
tmpPubKey: string;
pubEncyprt: string;
sourcePubkey: string;
encryptKey: string;

@@ -15,0 +15,0 @@ }>;

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,KAAK,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,gBAAgB,YAClB,OAAO,UACR,MAAM,WACL,OAAO,GAAG,OAAO;;;;;;;;;;;;EA0B3B,CAAC"}
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAKA,aAAK,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACrD,aAAK,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AAElC,eAAO,MAAM,gBAAgB,YAClB,OAAO,UACR,MAAM,WACL,OAAO,GAAG,OAAO;;;;;;;;;;;;EA0B3B,CAAC"}

@@ -34,2 +34,5 @@ "use strict";

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -40,3 +43,3 @@ exports.getEncryptParams = void 0;

const encoding_1 = require("@cosmjs/encoding");
const aes = __importStar(require("micro-aes-gcm"));
const micro_aes_gcm_1 = __importDefault(require("./micro-aes-gcm"));
const getEncryptParams = (privKey, pubKey, method) => __awaiter(void 0, void 0, void 0, function* () {

@@ -57,6 +60,6 @@ const encryptKey = (0, crypto_1.sha256)(secp.getSharedSecret(privKey, pubKey));

const sendPubKey = secp.getPublicKey(privKey, true);
const pubEncyprt = yield aes.encrypt(tmpEncryptKey, sendPubKey);
const pubEncyprt = yield micro_aes_gcm_1.default.encrypt(tmpEncryptKey, sendPubKey);
return {
tmpPubKey: (0, encoding_1.toBase64)(tmpPubKey),
pubEncyprt: (0, encoding_1.toBase64)(pubEncyprt),
sourcePubkey: (0, encoding_1.toBase64)(pubEncyprt),
encryptKey: (0, encoding_1.toBase64)(encryptKey),

@@ -63,0 +66,0 @@ };

@@ -1,1 +0,1 @@

{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,uDAAyC;AACzC,+CAA4C;AAC5C,mDAAqC;AAK9B,MAAM,gBAAgB,GAAG,CAC9B,OAAgB,EAChB,MAAc,EACd,MAA0B,EAC1B,EAAE;IACF,MAAM,UAAU,GAAG,IAAA,eAAM,EAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IAEjE,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,OAAO,EAAE,UAAU,EAAE,IAAA,mBAAQ,EAAC,UAAU,CAAC,EAAE,CAAC;KAC7C;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,IAAA,eAAM,EAAC,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAEvE,IAAI,MAAM,KAAK,OAAO,EAAE;QACtB,OAAO;YACL,SAAS,EAAE,IAAA,mBAAQ,EAAC,SAAS,CAAC;YAC9B,UAAU,EAAE,IAAA,mBAAQ,EAAC,aAAa,CAAC;SACpC,CAAC;KACH;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,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AED,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpD,MAAM,UAAU,GAAG,MAAM,uBAAG,CAAC,OAAO,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAChE,OAAO;QACL,SAAS,EAAE,IAAA,mBAAQ,EAAC,SAAS,CAAC;QAC9B,YAAY,EAAE,IAAA,mBAAQ,EAAC,UAAU,CAAC;QAClC,UAAU,EAAE,IAAA,mBAAQ,EAAC,UAAU,CAAC;KACjC,CAAC;AACJ,CAAC,CAAA,CAAC;AA7BW,QAAA,gBAAgB,oBA6B3B"}
{
"name": "@gotabit/crypto",
"description": "Cosmos Wallet core",
"version": "0.1.1",
"version": "0.1.2",
"author": "GotaBit DEV <dev@gotabit.org>",

@@ -68,6 +68,5 @@ "license": "MIT",

"fast-deep-equal": "^3.1.3",
"libsodium-wrappers": "^0.7.10",
"micro-aes-gcm": "^0.3.3"
"libsodium-wrappers": "^0.7.10"
},
"gitHead": "00dce20b5a495841e3efa958e23def7b3c397832"
"gitHead": "962b0816a0d610ae283e948f1bb0b49ab8ed2b03"
}