# tweetnacl-auth

> HMAC-SHA-512-256 based on TweetNaCl.js

Latest version **1.0.1** (published 2018-05-28) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install tweetnacl-auth
pnpm add tweetnacl-auth
yarn add tweetnacl-auth
bun add tweetnacl-auth
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-05-28 |
| First published | 2014-07-30 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Dmitry Chestnykh |
| Maintainers | dchest |
| Keywords | authentication, auth, crypto, hmac, hmac-sha512, nacl, tweetnacl |

## Links

- npm: https://www.npmjs.com/package/tweetnacl-auth
- Repository: https://github.com/dchest/tweetnacl-auth-js
- Issues: https://github.com/dchest/tweetnacl-auth-js/issues
- npm.io page: https://npm.io/package/tweetnacl-auth

## Dependencies (1)

- [tweetnacl](https://npm.io/package/tweetnacl.md) 1.x.x

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2018-05-28
- 0.3.1 — 2016-12-09
- 0.3.0 — 2015-07-13
- 0.2.4 — 2014-09-03
- 0.2.3 — 2014-08-06
- 0.2.2 — 2014-08-06
- 0.2.1 — 2014-08-06
- 0.2.0 — 2014-07-30
- 0.1.1 — 2014-07-30
- 0.1.0 — 2014-07-30

## README

HMAC-SHA-512-256 for TweetNacl.js
=================================

Implementation of <http://nacl.cr.yp.to/auth.html>
(requires [TweetNaCl.js](https://github.com/dchest/tweetnacl-js)).

Written in 2014 by Dmitry Chestnykh. Public domain.

[![Build Status](https://travis-ci.org/dchest/tweetnacl-auth-js.svg?branch=master)
](https://travis-ci.org/dchest/tweetnacl-auth-js)


Installation
------------

Via NPM:

    $ npm install tweetnacl-auth

or just download `nacl-auth.js` or `nacl-auth.min.js` and include it after
TweetNaCl.js:

```html
<script src="nacl.min.js"></script>
<script src="nacl-auth.min.js"></script>
```

If using a CommonJS environment, such as Node.js, you can import it into `nacl`
namespace:

```javascript
var nacl = require('tweetnacl');
nacl.auth = require('tweetnacl-auth');
```


Usage
-----


### nacl.auth(message, key)

Authenticates the given message with the secret key.
(In other words, returns HMAC-SHA-512-256 of the message under the key.)


### nacl.auth.full(message, key)

Returns HMAC-SHA-512 (without truncation) of the message under the key

### nacl.auth.authLength = 32

Length of authenticator returned by `nacl.auth`.

### nacl.auth.authFullLength = 64

Length of authenticator returned by `nacl.auth.full`.

### nacl.auth.keyLength = 32

Length of key for `nacl.auth` and `nacl.auth.full` (key length is currently not
enforced).

---
_Source: https://npm.io/package/tweetnacl-auth · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
