npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pfcti-toolbox-enigmalib

v1.1.4

Published

Contiene los algoritmos de cifrado y hash utilizados por el grupo.

Readme

Pfcti.ToolBox.EnigmaLib.NodeJS

Paquete contiene los métodos de encriptación y desencriptación utilizando el algoritmo AES256. Asimismo contiene un utilitario para crear hash SHA256.

Prerequisitos

Las herramientas requeridas son

npm cli
NodeJs
Visual Studio Code

En Visual Studio Code agregar los siguientes Settings

"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false

Accessos

nexus-repository.pfcti.com (10.23.13.88)

Configuración

Se debe crear en el proyecto que va a utilizar el consumidor un archivo en la raíz con el nombre ".npmrc" con la siguiente información:

@pfcti:registry = http://nexus-repository.pfcti.com/repository/npm-hosted/
[email protected]
always-auth=true
_auth=dXNlcnB1bGw6UEZDdGkyMDE5

Esto nos permite buscar los repositorios internos

Para descargar las librerías:

$ npm install

Estilo de codificación y estructura

Para consultar los detalles de codificación por favor acceder a

  • Estándar Typescript - Contiene las referencias a las guías y pautas que se debe tener a consideración para el desarrollo.

Construcción del proyecto

Para construir el servicio utilice

npm run-script build

El proceso de contrucción verifica que se cumplan con los estándares de desarrollo y genera la carpeta dist que contiene consumidor disponible para su uso.

Implementación

Se requiere el package llamado @pfcti/pfcti-toolbox-enigmalib

npm install @pfcti/pfcti-toolbox-enigmalib

Para utilizar la librería se hace de la siguiente forma

Responsabilidades

  1. El cliente almacenará el key utilizados para los procesos
  2. El iv será generado del lado del cliente, se recomienda crypto para la esta generación
  3. Los valores key, IV SON en hexadecimal, se recomienda el toString('hex')

Encriptar datos AES256 TS

import * as Crypto from 'crypto';
import { AesGcm256Service } from '@pfcti/pfcti-toolbox-enigmalib';
...
try{
    let iv = Crypto.randomBytes(16).toString('hex');
    let result = new AesGcm256Service().Encrypt(key, iv, JSON.stringify(request));
    console.debug(result.AssociatedData);
    console.debug(result.MacLength);
    console.debug(result.CypherValue);
}
catch(ex)
{
    //TODO
}

Encriptar datos AES256 NodeJS

const crypto = require('crypto')
const pfctiCypher = require('@pfcti/pfcti-toolbox-enigmalib')
...
try{
    let iv = crypto.randomBytes(16).toString('hex');
    let result = new pfctiCypher.AesGcm256Service().Encrypt(key, iv, JSON.stringify(request));
    console.debug(result.AssociatedData);
    console.debug(result.MacLength);
    console.debug(result.CypherValue);
}
catch(ex)
{
    //TODO
}

Desencriptar datos AES256 TS

import { AesGcm256Service } from '@pfcti/pfcti-toolbox-enigmalib';
...
try{
    let result = new AesGcm256Service().Decrypt(key, 
          associatedData, 
          iv, 
          macLength,
          cypherValue);
    console.debug(result);
}
catch(ex)
{
    //TODO
}

Desencriptar datos AES256 NodeJS

const pfctiCypher = require('@pfcti/pfcti-toolbox-enigmalib')
...
try{
    let result = new pfctiCypher.AesGcm256Service().Decrypt(key, 
          associatedData, 
          iv, 
          macLength,
          cypherValue);
    console.debug(result);
}
catch(ex)
{
    //TODO
}

Hash SHA256 TS

import { HmacSha256Service } from '@pfcti/pfcti-toolbox-enigmalib';
...
try{
    let result = new HmacSha256Service().Create(key, 
          JSON.stringify(request));
    console.debug(result);
}
catch(ex)
{
    //TODO
}

Hash SHA256 NodeJS

const pfctiCypher = require('@pfcti/pfcti-toolbox-enigmalib')
...
try{
    let result = new pfctiCypher.HmacSha256Service().Create(key, 
          JSON.stringify(request));
    console.debug(result);
}
catch(ex)
{
    //TODO
}

Validar Hash SHA256 TS

import { HmacSha256Service } from '@pfcti/pfcti-toolbox-enigmalib';
...
try{
    let result = new HmacSha256Service().Validate(key, hash,
          JSON.stringify(request));
    console.debug(result);
}
catch(ex)
{
    //TODO
}

Hash SHA256 NodeJS

const pfctiCypher = require('@pfcti/pfcti-toolbox-enigmalib')
...
try{
    let result = new pfctiCypher.HmacSha256Service().Validate(key, hash,
          JSON.stringify(request));
    console.debug(result);
}
catch(ex)
{
    //TODO
}

Construído con

License

Copyright © 2020 [PFCTI]