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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@deepmojo/crypto-core

v1.0.0

Published

> ⚠️ **SECURITY NOTICE** ⚠️ > > This library has not undergone extensive production testing or security auditing. Use in production environments is not recommended at this time. For research and development purposes only.

Downloads

79

Readme

DeepMojo Crypto-Core Jest Test Suite Badge

⚠️ SECURITY NOTICE ⚠️

This library has not undergone extensive production testing or security auditing. Use in production environments is not recommended at this time. For research and development purposes only.

Overview

DeepMojo Crypto-Core is a robust TypeScript cryptography library designed for Node.js and Electron environments. It provides a streamlined interface to cryptographic operations with secure defaults, built on top of the battle-tested node:crypto module.

📚 View our Official API Docs 📚

Key Features

  • 🔒 Comprehensive toolkit of major cryptographic operations
    • 🔢 RNG & Key Derivation - Secure random number generation and key derivation functions with industry-standard algorithms.
    • 🧠 World-Class Encryption/Decryption - AES-GCM-256 encryption with authenticated encryption support.
    • Password-Only Encryption/Decryption - Simplified APIs for password-only encryption scenarios.
    • 🧮 Cryptographic Utilities - Including hashing and digital signatures capabilities.
    • 🗝️ Key Management - Public/private key pair generation and management utilities.
  • 🚀 Both synchronous and asynchronous APIs
  • 💪 Strong default security parameters
  • 🧪 Comprehensive test coverage with Jest
  • 🔍 TypeScript-first development

Project Status

| Objective | Status | Description | |-----------|--------|-------------| | Cross-Platform Support | ✅ 100% | Full compatibility across Windows, macOS, and Linux | | Security-First Design | ✅ 100% | Enforces secure defaults with simplified developer experience | | Security Best Practices | 🚧 66% | Pending: GHSA integration |

Installation

npm install @deepmojo/crypto-core

# or for yarn

yarn add @deepmojo/crypto-core

Pro Tip: In newer versions of yarn, to get a local node_modules folder you will want yarn config set nodeLinker node-modules.

Build

npm run build or yarn build: Compiles the TypeScript code using the tsconfig.json configuration file. This script is used to build the project and prepare it for distribution.

npm run build:typedoc:html: Generates HTML site documentation in ./docs as needed for generating the GitHub Pages documentation for this library.

npm run build:typedoc:json: Generates a typedoc.json in the root of the project, as needed for generating the static documentation for this library.

Test

npm run test or yarn test: Runs the Jest test suite with verbose output and code coverage reporting. This script is used to test the project and ensure that it is working as expected.

Usage

Here's an example of how to use the CryptoCore library to encrypt and decrypt a string:

import CryptoCore, { CryptoCoreOptions, getUTF8StringFromBuffer } from "@deepmojo/crypto-core";

const options: CryptoCoreOptions = {
  OUTER_PEPPER: 'pepper is yum',
  INNER_KEY_ITERATIONS: 100,
};

let cryptoCore: CryptoCore;

beforeAll(() => {
  cryptoCore = new CryptoCore(options);
});

const salt = cryptoCore.getRandomSalt();

// Encrypt
const encryptResult = cryptoCore.getEncryptedStringSync('Hello, World!', 'secret password', salt);

// Decrypt
const decryptedString = cryptoCore.getDecryptedStringSync(
  getHexStringFromBuffer(encryptResult.result),
  password,
  salt,
  encryptResult.iv,
  encryptResult.authTag
);

For more examples and usage scenarios, please refer to the tests in the src/tests directory.

Future Research

  • Chromium SafeStorage API wrapper
  • OTP/TOTP/Authenticator
  • Pin/pattern hashing and verification
  • JWE/JWK authentication
  • Windows Credential Locker
  • HSM, TPM, PAM, MFA, 2FA
  • Hardware security: FIDO U2F, WebAuthn/FIDO2, TrustKey, Yubikey
  • macOS Secure Enclave integration

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Security

For security concerns, please review our Security Policy.

License

MIT


This project adheres to Semantic Versioning.