All Projects → PeculiarVentures → Node Webcrypto Ossl

PeculiarVentures / Node Webcrypto Ossl

Licence: mit
A WebCrypto Polyfill for Node in TypeScript built on OpenSSL.

Projects that are alternatives of or similar to Node Webcrypto Ossl

user guide
The CWL v1.0 user guide
Stars: ✭ 20 (-82.3%)
Mutual labels:  workflow, workflows
Onepanel
The open and extensible integrated development environment (IDE) for computer vision with built-in modules for model building, automated labeling, data processing, model training, hyperparameter tuning and workflow orchestration.
Stars: ✭ 428 (+278.76%)
Mutual labels:  workflows, workflow
nactivity
workflow engine activity activiti
Stars: ✭ 55 (-51.33%)
Mutual labels:  workflow, workflows
Open Crypto
🔑 Hashing (BCrypt, SHA2, HMAC), encryption (AES), public-key (RSA), and random data generation.
Stars: ✭ 115 (+1.77%)
Mutual labels:  hash, rsa
River Admin
🚀 A shiny admin interface for django-river built with DRF, Vue & Vuetify
Stars: ✭ 55 (-51.33%)
Mutual labels:  workflows, workflow
Active hash relation
ActiveHash Relation: Simple gem that allows you to run multiple ActiveRecord::Relation using hash. Perfect for APIs.
Stars: ✭ 115 (+1.77%)
Mutual labels:  api, hash
Gh Action Pypi Publish
GitHub Action, for publishing distribution files to PyPI
Stars: ✭ 317 (+180.53%)
Mutual labels:  workflows, workflow
Microwf
A simple finite state machine (FSM) with workflow character where you define your workflows in code.
Stars: ✭ 122 (+7.96%)
Mutual labels:  workflows, workflow
Hashapi Lib Node
Tierion Hash API client library for Node.js
Stars: ✭ 20 (-82.3%)
Mutual labels:  api, hash
Sooty
The SOC Analysts all-in-one CLI tool to automate and speed up workflow.
Stars: ✭ 867 (+667.26%)
Mutual labels:  hash, workflow
Aiida Core
The official repository for the AiiDA code
Stars: ✭ 238 (+110.62%)
Mutual labels:  workflows, workflow
Common Workflow Language
Repository for the CWL standards. Use https://cwl.discourse.group/ for support 😊
Stars: ✭ 1,222 (+981.42%)
Mutual labels:  workflows, workflow
Alfred Workflow
Full-featured library for writing Alfred 3 & 4 workflows
Stars: ✭ 2,622 (+2220.35%)
Mutual labels:  workflows, workflow
enigma
A fast, native, cryptographic engine for the web
Stars: ✭ 101 (-10.62%)
Mutual labels:  rsa, hash
Go Codon
Workflow based REST framework code generator
Stars: ✭ 133 (+17.7%)
Mutual labels:  workflows, workflow
Tesseract
A set of libraries for rapidly developing Pipeline driven micro/macroservices.
Stars: ✭ 20 (-82.3%)
Mutual labels:  workflow, workflows
Pipedream
Connect APIs, remarkably fast. Free for developers.
Stars: ✭ 2,068 (+1730.09%)
Mutual labels:  workflows, workflow
Gush
Fast and distributed workflow runner using ActiveJob and Redis
Stars: ✭ 894 (+691.15%)
Mutual labels:  workflows, workflow
Maestrowf
A tool to easily orchestrate general computational workflows both locally and on supercomputers
Stars: ✭ 72 (-36.28%)
Mutual labels:  workflows, workflow
Opensubtitles Api
nodejs opensubtitles.org api wrapper for downloading and uploading subtitles in multiple langs
Stars: ✭ 96 (-15.04%)
Mutual labels:  api, hash

node-webcrypto-ossl

License Build Status Coverage Status npm version

NPM

We wanted to be able to write Javascript that used crypto on both the client and the server but we did not want to rely on Javascript implementations of crypto. The only native cryptography available in browser is Web Crypto, this resulted in us creating a node-webcrypto-ossl a native polyfill for WebCrypto based on OpenSSL since at the time Node did not have a native WebCrypto implementation. As of Node 15 however they have added such a interface so you may not need this module any longer.

Table Of Contents

WARNING

At this time this solution should be considered suitable for research and experimentation, further code and security review is needed before utilization in a production application.

Installation

npm

npm install node-webcrypto-ossl;

Clone Repo

git clone https://github.com/PeculiarVentures/node-webcrypto-ossl
cd node-webcrypto-ossl

Install

npm install

Test

mocha

Supported algorithms

Algorithm name generateKey digest export/import sign/verify encrypt/decrypt wrapKey/unwrapKey derive
SHA-1 X
SHA-256 X
SHA-384 X
SHA-512 X
RSASSA-PKCS1-v1_5 X X X
RSA-PSS X X X
RSA-OAEP X X X X
AES-CBC X X X X
AES-CTR X X X X
AES-ECB 2 X X X X
AES-GCM X X X X
AES-KW X X X
AES-CMAC X X X
ECDSA X X X
ECDH X X X
HMAC X X X
PBKDF2 X X
DES-CBC X X X X
DES-EDE3-CBC X X X X

2 ECB support is not defined by the WebCrypto specifications. Use of ECB in a safe way is hard, it was added for the purpose of enabling interoperability with an existing system. We recommend against its use unless needed for interoperability.

Using

import { Crypto } from "node-webcrypto-ossl";

const crypto = new Crypto();

Elliptic curve secp256k1

secp256k1 curve is not defined by the WebCrypto specifications. This module implements K-256 curve for ECDSA algorithm.

K-256 curve examples

KeyStorage

To use KeyStorage you should init WebCrypto with directory option. If directory option is missing then keyStorage is null

const { Crypto } = require("node-webcrypto-ossl");

const crypto = new Crypto({
  directory: "key_storage"
})

KeyStorage implements interface of W3 Storage

// generating RSA key
const keys = await crypto.subtle.generateKey({
    name: "RSASSA-PKCS1-v1_5",
    modulusLength: 1024,
    publicExponent: new Uint8Array([1, 0, 1]),
    hash: {
      name: "SHA-1"
    }
  },
    false,
    ["sign", "verify"]
  );

/** 
 * saving private RSA key to KeyStorage
 * creates file ./key_storage/prvRSA-1024
 */
await crypto.keyStorage.setItem(keyPairs.privateKey, "prvRSA-1024");

To get key from KeyStorage

var rsaKey = await webcrypto.keyStorage.getItem("prvRSA-1024");

Threat Model

The threat model is defined in terms of what each possible attacker can achieve.

Assumptions

TODO: ADD ASSUMPTIONS

Threats From A node-webcrypto-ossl Defect

TODO: ADD THREATS FROM NODE-WEBCRYPTO-OSSL DEFECT

Threats From Weak Cryptography

TODO: ADD THREATS FROM WEAK CRYPTOGRAPHY

Threats From Improper Use Of Cryptography

TODO: ADD THREATS FOR IMPROPER USE OF CRYPTOGRAPHY

Bug Reporting

Please report bugs either as pull requests or as issues in the issue tracker. node-webcrypto-ossl has a full disclosure vulnerability policy. Please do NOT attempt to report any security vulnerability in this code privately to anybody.

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].