Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cryptocoinjs/drbg.js
Deterministic Random Bit Generators from NIST SP 800-90A
https://github.com/cryptocoinjs/drbg.js
Last synced: 3 months ago
JSON representation
Deterministic Random Bit Generators from NIST SP 800-90A
- Host: GitHub
- URL: https://github.com/cryptocoinjs/drbg.js
- Owner: cryptocoinjs
- License: other
- Created: 2016-02-13T17:56:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-02-17T13:50:00.000Z (over 8 years ago)
- Last Synced: 2024-07-18T15:49:23.975Z (4 months ago)
- Language: JavaScript
- Size: 1.46 MB
- Stars: 7
- Watchers: 6
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cryptocoinjs - * - 90A (List of content / Cryptography)
README
# drbg.js
[![NPM Package](https://img.shields.io/npm/v/drbg.js.svg?style=flat-square)](https://www.npmjs.org/package/drbg.js)
[![Build Status](https://img.shields.io/travis/cryptocoinjs/drbg.js.svg?branch=master&style=flat-square)](https://travis-ci.org/cryptocoinjs/drbg.js)
[![Dependency status](https://img.shields.io/david/cryptocoinjs/drbg.js.svg?style=flat-square)](https://david-dm.org/cryptocoinjs/drbg.js#info=dependencies)[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
Deterministic Random Bits Generators
Based on NIST Recommended DRBG from [NIST SP800-90A](https://en.wikipedia.org/wiki/NIST_SP_800-90A) with the following properties:
* CTR DRBG with DF with AES-128, AES-192, AES-256 cores see [issue #1](https://github.com/cryptocoinjs/drbg.js/issues/1)
* Hash DRBG with DF with SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 cores
* HMAC DRBG with SHA-1, SHA-224, SHA-256, SHA-384, SHA-512 cores
* with and without prediction resistance## Installation
```shell
npm install drbg.js
```## Usage
```javascript
var drbgs = require('drbg.js') // import HashDRBG and HmacDRBG
var HashDRBG = drbgs.HashDRBG // or require('drbg.js/hash')
var HmacDRBG = drbgs.HmacDRBG // or require('drbg.js/hmac')var drbg2 = new HashDRBG('sha256', entropy, nonce, personalization_data)
drbg2.generate(5, additional_data) //
drbg2.reseed(entropy, personalization_data)
drbg2.generate(5, additional_data) //var drbg3 = new HmacDRBG('sha256', entropy, nonce, personalization_data)
drbg3.generate(5, additional_data) //
drbg3.reseed(entropy, personalization_data)
drbg3.generate(5, additional_data) //
```## LICENSE
This library is free and open-source software released under the MIT license.