open-index/open-npm huggingface dataset:
npm package: @niomon/noise-js
Description: Typescript implementation of the Noise Protocol Framework
Author: Enyk Limited
Latest version: 2.0.1

# `noise-js`

> Javascript implementation of the Noise Protocol Framework that works in both browsers and Node.js

Note that this implementation is low level and requires knowledge of the
[Noise Protocol Framework](http://noiseprotocol.org/noise.html), and is aimed to
be a building block for higher-level modules wishing to implement
application-specific handshakes securely.

## Supported Features

### DH functions, cipher functions, and hash functions

- `25519`
- `AESGCM`
- `SHA256`

### Patterns

All one-way and fundamental handshake patterns are currently supported:

- `N`
- `K`
- `X`
- `NN`
- `KN`
- `NK`
- `KK`
- `NX`
- `KX`
- `XN`
- `IN`
- `XK`
- `IK`
- `XX`
- `IX`

### Modifiers

- `psk`

## Usage

```js
var noise = require('noise-js')

var sClient = noise.generateKeypair()
var sServer = noise.generateKeypair()

// Initialize a Noise_KK_25519_AESGCM_SHA256 handshake
var client = noise.initialize('KK', true, Buffer.alloc(0), sClient, null, sServer.publicKey)
var server = noise.initialize('KK', false, Buffer.alloc(0), sServer, null, sClient.publicKey)

// -> e, es, ss
var clientTx = client.writeMessage(Buffer.alloc(0))
var serverRx = server.readMessage(clientTx)

// <- e, ee, se
var serverTx = server.writeMessage(Buffer.alloc(0))
var serverSplit = server.split()
var clientRx = client.readMessage(serverTx)
var clientSplit = client.split()

// Can now do transport encryption with splits
console.log(serverSplit)
console.log(clientSplit)
```

## License

[Apache License 2.0](LICENSE)

Portions of this product may utilize third party copyrighted material, the use of which is
acknowledged in the [NOTICE](NOTICE) file.
npm package: @niomon/spake2
Description: A Javascript package for SPAKE2 and SPAKE2+
Author: Samuel Tang
Latest version: 1.0.4

spake2-js
===

The SPAKE2 password-authenticated key-exchange algorithm, in Javascript.

This implementation focus on following [draft-irtf-cfrg-spake2-08](https://gitlab.com/blocksq/spake2-go/master/standard-url) with SPAKE2, SPAKE2+ and key confirmation.

This have not go through a formal cryptographic audit and should be awared in any use case.

Also this do not protect against time attacks as operations are probably not constant-time.