An open API service indexing awesome lists of open source software.

https://github.com/elbywan/shannon-bindings

Shannon cipher node.js bindings
https://github.com/elbywan/shannon-bindings

shannon shannon-algorithm shannon-cipher

Last synced: 6 months ago
JSON representation

Shannon cipher node.js bindings

Awesome Lists containing this project

README

          

# shannon-bindings
#### Node.js bindings for the Shannon cipher

Check the [reference implementation repository mirror](https://github.com/timniederhausen/shannon) for more details.

## Setup

`npm i shannon-bindings`

## Usage

```js
const Shannon = require('shannon-bindings')

const shannon = new Shannon(key /* Buffer */)

shannon.nonce(nonce /* Buffer */)
shannon.decrypt(encryptedBuffer /* Buffer, decrypted in place */)
shannon.encrypt(buffer /* Buffer, encrypted in place */)

/* mac is calculated in-place */
const mac = Buffer.alloc(N)
shannon.mac(mac)
```