# encryption-se

> A simple module wrapping around NodeJS Crypto module (AES-CBC-256) allowing handling IV by prefixing it to encrypted string.

Latest version **1.0.3** (published 2021-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install encryption-se
pnpm add encryption-se
yarn add encryption-se
bun add encryption-se
```

## 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 | 2021-06-23 |
| First published | 2017-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mihovil Strujic |
| Maintainers | michaelortho |

## Links

- npm: https://www.npmjs.com/package/encryption-se
- Repository: https://bitbucket.org/SeaExc/se.security.encryption
- Homepage: https://www.npmjs.com/package/encryption-se
- Issues: https://bitbucket.org/SeaExc/se.security.encryption/issues
- npm.io page: https://npm.io/package/encryption-se

## Recent versions

- 1.0.3 (latest) — 2021-06-23
- 1.0.2 — 2021-06-23
- 1.0.1 — 2021-04-22
- 1.0.0 — 2021-04-22
- 0.6.1 — 2020-02-19
- 0.6.0 — 2020-02-19
- 0.5.4 — 2019-08-15
- 0.5.3 — 2019-08-15
- 0.5.1 — 2019-07-16
- 0.1.1 — 2017-09-03
- 0.1.0 — 2017-09-03
- 0.0.5 — 2017-09-03
- 0.0.4 — 2017-09-03
- 0.0.3 — 2017-09-03
- 0.0.2 — 2017-09-03
- … 1 more at https://npm.io/package/encryption-se/versions

## README

# Encryption SE

[![NPM Version](https://img.shields.io/npm/v/encryption-se.svg?style=flat)](https://www.npmjs.org/package/encryption-se)
[![NPM Downloads](https://img.shields.io/npm/dm/encryption-se.svg?style=flat)](https://npmcharts.com/compare/encryption-se?minimal=true)
[![Install Size](https://packagephobia.now.sh/badge?p=encryption-se)](https://packagephobia.now.sh/result?p=encryption-se)
[![CircleCI](https://circleci.com/bb/SeaExc/se.security.encryption.svg?style=shield)](https://circleci.com/bb/SeaExc/se.security.encryption)
[![Coverage Status](https://coveralls.io/repos/bitbucket/SeaExc/se.security.encryption/badge.svg?branch=master)](https://coveralls.io/bitbucket/SeaExc/se.security.encryption?branch=master)

### Description
A simple module wrapping around NodeJS Crypto module allowing handling IV by prefixing it to encrypted string.

## Options
Name | Default | Description
:--- | --- | :---
`password` | `null` | Password secret **REQUIRED**
`passwordSalt` | `This is my salt 362` | Password salt
`iterationCount` | `100000` | Number of iterations for PBKDF2
`encryptionKey` | `null` | Encryption key as array of bytes

### How to use it
#### Installation

```shell

// First you have to get module and instantiate it

npm install encryption-se

OR

yarn add encryption-se

```

After installing module, add this to your code:

```javascript
const options = {
  password: process.env.encryptionPassword || 'SomePassword'
};

const encryption = require('encryption-se')(options);
```

#### How to encrypt?
```javascript
encryption
  .encrypt('This is to be encrypted')
  .then(enc => {
    // 'enc' contains encrypted string in base64 format
  })
  .catch((err) => {
    // This is to handle errors
  })
```

####  How to decrypt?
```javascript
encryption
  .decrypt('iQ6qlRWlwWXtmGPFbBiEc4WKKAbHCLQK0+HLxoGLKY0=')
  .then((text) => {
    // 'text' contains decrypted string
  })
  .catch((err) => {
    // This is to handle errors
  })
```

### Contact

[![Image](https://static-exp1.licdn.com/scds/common/u/images/logos/linkedin/logo_linkedin_93x21_v2.png)](https://www.linkedin.com/in/mihovilstrujic)

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