# @klayr/cryptography

> General cryptographic functions for use with Klayr-related software

Latest version **4.1.1** (published 2024-08-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @klayr/cryptography
pnpm add @klayr/cryptography
yarn add @klayr/cryptography
bun add @klayr/cryptography
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.1.1 |
| Published | 2024-08-19 |
| First published | 2024-04-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18.12.0 <=18 |
| Dependencies | 4 |
| Unpacked size | 116.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Klayr Labs |
| Maintainers | corbifex |
| Keywords | klayr, blockchain |

## Links

- npm: https://www.npmjs.com/package/@klayr/cryptography
- Repository: https://github.com/Klayrhq/klayr-sdk
- Homepage: https://github.com/Klayrhq/klayr-sdk/tree/master/elements/cryptography#readme
- Issues: https://github.com/Klayrhq/klayr-sdk/issues
- npm.io page: https://npm.io/package/@klayr/cryptography

## Dependencies (4)

- [hash-wasm](https://npm.io/package/hash-wasm.md) 4.9.0
- [tweetnacl](https://npm.io/package/tweetnacl.md) 1.0.3
- [buffer-reverse](https://npm.io/package/buffer-reverse.md) 1.0.1
- [@klayr/passphrase](https://npm.io/package/@klayr/passphrase.md) ^4.1.1

## Recent versions

- 4.1.1 (latest) — 2024-08-19
- 4.1.0 — 2024-08-16
- 4.0.2 — 2024-04-22
- 4.0.1 — 2024-04-16

## README

# @klayr/cryptography

@klayr/cryptography is containing general cryptographic functions for use with Klayr-related software

## Installation

```sh
$ npm install --save @klayr/cryptography
```

## Benchmarking

Install optional dependencies:

```sh
$ npm i -D benchmark sodium-native
```

Benchmark nacl functions:

```sh
$ npx babel-node ./benchmark/nacl
```

Benchmark results for nacl functions:

|    Function    |           Fast           |           Slow           | Winner |
| :------------: | :----------------------: | :----------------------: | :----: |
|      box       | x 23,982 ops/sec ±0.59%  |   x 771 ops/sec ±0.44%   |  Fast  |
|    openBox     | x 24,247 ops/sec ±0.42%  |   x 770 ops/sec ±0.69%   |  Fast  |
|  signDetached  | x 46,402 ops/sec ±0.32%  |   x 236 ops/sec ±1.63%   |  Fast  |
| verifyDetached | x 17,153 ops/sec ±0.19%  |   x 122 ops/sec ±0.61%   |  Fast  |
| getRandomBytes | x 207,866 ops/sec ±0.23% | x 299,959 ops/sec ±0.39% |  Slow  |
|   getKeyPair   | x 38,815 ops/sec ±0.16%  |   x 242 ops/sec ±0.62%   |  Fast  |

## License

Copyright 2016-2020 Lisk Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

[klayr core github]: https://github.com/Klayrhq/klayr
[klayr documentation site]: https://klayr.xyz/documentation/klayr-sdk/references/klayr-elements/cryptography.html

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