# cryptlib

> CryptLib uses AES 256 for encryption or decryption. This library can be used for encryption and decryption of strings using Node on iOS, Android and Windows

Latest version **1.0.3** (published 2015-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cryptlib
pnpm add cryptlib
yarn add cryptlib
bun add cryptlib
```

## 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.3 |
| Published | 2015-09-15 |
| First published | 2015-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Abdul Khan |
| Maintainers | invalidred, anvk |
| Keywords | AES node, Cross Platform, Encryption, Decryption |

## Links

- npm: https://www.npmjs.com/package/cryptlib
- Repository: https://github.com/invalidred/cryptlib
- Issues: https://github.com/invalidred/cryptlib/issues
- npm.io page: https://npm.io/package/cryptlib

## Dependencies (1)

- [bl](https://npm.io/package/bl.md) 1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2015-09-15
- 1.0.2 — 2015-07-31
- 1.0.1 — 2015-07-31
- 1.0.0 — 2015-07-27

## README

# cryptlib [![Build Status](https://travis-ci.org/invalidred/cryptlib.svg?branch=master)](https://travis-ci.org/invalidred/cryptlib)

A module to encrypt/decrypt string in Node, written in ES6 (src folder) and transpiled using Babel to ES5(dist folder).

Using companion framework libraries, you should be able to encrypt/decrypt between node, iOS, Android and Windows platforms.

Companion libs can be found here: [Cross Platform AES Encryption](https://github.com/Pakhee/Cross-platform-AES-encryption)


## Installation

`npm install cryptlib --save`

## Usage

### Encrypt

```javascript
var cryptLib = require('cryptlib'),
    iv = cryptLib.generateRandomIV(16), //16 bytes = 128 bit
    key = cryptLib.getHashSha256('my secret key', 32), //32 bytes = 256 bits
    encryptedText = cryptLib.encrypt('This is the text to be encrypted', key, iv);
```

### Decrypt

```javascript
var cryptLib = require('cryptlib'),
    iv = 'iv vector used for encryption',
    key = cryptLib.getHashSha256('my secret key', 32), //32 bytes = 256 bits
    originalText = cryptLib.decrypt('M2rfrn9DqNHJe3Hev9nMxKKgIHoqUsc7FJM+tBGxIrl3Wk9UeKIQ5fRUUZF3q2i5', key, iv);
```

## Run Code Sample

`npm start`

## Tests

`npm test`

## Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.

## Release History

* 2015-09-14	1.0.3 fixed issue with Package.json
* 2015-07-31    1.0.2 Integrated travis ci
* 2015-07-30    1.0.1 Few basic structure changes
* 2015-07-26    1.0.0 Initial release

## License

MIT license; see [LICENSE](./LICENSE).

(c) 2015 by Abdul Khan and Alexey Novak

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