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

namirasoft-core

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

namirasoft-core - npm Package Compare versions

Comparing version 1.2.13 to 1.2.14

dist/SignOperation.d.ts

18

dist/EncryptionOperation.js

@@ -30,11 +30,19 @@ "use strict";

static encrypt(algorithm, secret, message) {
const iv = Buffer.alloc(16, 0);
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(algorithm, secret, iv);
return cipher.update(JSON.stringify(message), 'utf8', 'hex') + cipher.final('hex');
const encrypted = Buffer.concat([cipher.update(JSON.stringify(message), 'utf8'), cipher.final()]);
const authTag = cipher.getAuthTag();
const ivHex = iv.toString('hex');
const authTagHex = authTag.toString('hex');
const encryptedHex = encrypted.toString('hex');
return [ivHex, authTagHex, encryptedHex].join(";");
}
static decrypt(algorithm, secret, message) {
let encryptedText = Buffer.from(message, 'hex');
const iv = Buffer.alloc(16, 0);
const [ivHex, authTagHex, encryptedHex] = message.split(';');
const iv = Buffer.from(ivHex, 'hex');
const authTag = Buffer.from(authTagHex, 'hex');
const encrypte = Buffer.from(encryptedHex, 'hex');
const decipher = crypto.createDecipheriv(algorithm, secret, iv);
let decrypted = decipher.update(encryptedText);
decipher.setAuthTag(authTag);
let decrypted = decipher.update(encrypte);
decrypted = Buffer.concat([decrypted, decipher.final()]);

@@ -41,0 +49,0 @@ return JSON.parse(decrypted.toString());

{
"name": "namirasoft-core",
"description": "Namira Software Corporation Core NPM Package",
"version": "1.2.13",
"version": "1.2.14",
"main": "./dist/index.js",

@@ -11,3 +11,3 @@ "types": "./dist/index.d.ts",

"dependencies": {
"@types/node": "^20.11.24",
"@types/node": "^20.11.25",
"axios": "^1.6.7",

@@ -14,0 +14,0 @@ "moment": "^2.30.1",

@@ -0,0 +0,0 @@ export type BaseDatabaseRow<ID> =

@@ -0,0 +0,0 @@ import axios, { AxiosRequestConfig, AxiosResponse } from "axios";

@@ -0,0 +0,0 @@ import { ErrorOperation } from "./ErrorOperation";

@@ -0,0 +0,0 @@ import { Country } from "./Country";

@@ -0,0 +0,0 @@ export class Country

@@ -0,0 +0,0 @@ import { Country } from "./Country";

@@ -7,14 +7,22 @@ import * as crypto from 'node:crypto';

{
const iv = Buffer.alloc(16, 0);
const iv = crypto.randomBytes(16);
const cipher = crypto.createCipheriv(algorithm, secret, iv);
return cipher.update(JSON.stringify(message), 'utf8', 'hex') + cipher.final('hex');
const encrypted = Buffer.concat([cipher.update(JSON.stringify(message), 'utf8'), cipher.final()]);
const authTag = (cipher as any).getAuthTag();
const ivHex = iv.toString('hex');
const authTagHex = authTag.toString('hex');
const encryptedHex = encrypted.toString('hex');
return [ivHex, authTagHex, encryptedHex].join(";");
}
private static decrypt<T>(algorithm: string, secret: string, message: string): T
{
let encryptedText = Buffer.from(message, 'hex');
const [ivHex, authTagHex, encryptedHex] = message.split(';');
const iv = Buffer.from(ivHex, 'hex');
const authTag = Buffer.from(authTagHex, 'hex');
const encrypte = Buffer.from(encryptedHex, 'hex');
const iv = Buffer.alloc(16, 0);
const decipher = crypto.createDecipheriv(algorithm, secret, iv);
(decipher as any).setAuthTag(authTag);
let decrypted = decipher.update(encryptedText);
let decrypted = decipher.update(encrypte);
decrypted = Buffer.concat([decrypted, decipher.final()]);

@@ -21,0 +29,0 @@ return JSON.parse(decrypted.toString());

@@ -0,0 +0,0 @@ import { HTTPError } from "./HTTPError";

@@ -0,0 +0,0 @@ let fs: any;

@@ -0,0 +0,0 @@ export class GeoOperation

@@ -0,0 +0,0 @@ import * as crypto from 'node:crypto';

@@ -0,0 +0,0 @@ export class HTTPError extends Error

@@ -0,0 +0,0 @@ export enum HTTPMethod

@@ -0,0 +0,0 @@ export * from "./BaseDatabaseRow";

@@ -0,0 +0,0 @@ export abstract class IStorage

@@ -0,0 +0,0 @@ import { IStorage } from "./IStorage.js";

@@ -0,0 +0,0 @@ import { IStorage } from "./IStorage";

@@ -0,0 +0,0 @@ import { ConvertService } from "./ConvertService";

@@ -0,0 +0,0 @@ let fs: any;

@@ -0,0 +0,0 @@ import * as Phone from 'phone';

@@ -0,0 +0,0 @@ export class StringOperation

@@ -0,0 +0,0 @@ import moment from "moment";

@@ -0,0 +0,0 @@ import { ParsedNameValue } from "./ParsedNameValue";

@@ -0,0 +0,0 @@ export class VersionOperation

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

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