# aes-decrypter

> decrypt aes-128 content using a key

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

## Install

```sh
npm install aes-decrypter
pnpm add aes-decrypter
yarn add aes-decrypter
bun add aes-decrypter
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.2 |
| Published | 2024-08-22 |
| First published | 2016-06-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 78.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Brightcove, Inc. |
| Maintainers | phale, ddashkevich, roman-bc, walterseymourbc, videojs-user, usmanonazim, mmcclure, misteroneill, misterben, lday, imbcmdth, hswaminathan, heff, gkatsev, gesinger, essk, dmlap, brandonocasey, awaldron, abarstow, durumcrustulum, forbesjo |
| Keywords | videojs, videojs-plugin |

## Links

- npm: https://www.npmjs.com/package/aes-decrypter
- Repository: https://github.com/videojs/aes-decrypter
- Homepage: https://github.com/videojs/aes-decrypter#readme
- Issues: https://github.com/videojs/aes-decrypter/issues
- npm.io page: https://npm.io/package/aes-decrypter

## Dependencies (4)

- [pkcs7](https://npm.io/package/pkcs7.md) ^1.0.4
- [global](https://npm.io/package/global.md) ^4.4.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.12.5
- [@videojs/vhs-utils](https://npm.io/package/@videojs/vhs-utils.md) ^4.1.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 4.0.2 (latest) — 2024-08-22
- 3.0.1 (experimental) — 2019-08-21
- 3.0.1-0 (next) — 2019-08-16
- 1.0.0-0 (beta) — 2016-06-16
- 4.0.1 — 2022-08-19
- 3.1.3 — 2022-04-05
- 3.1.2 — 2021-01-12
- 3.1.1 — 2021-01-11
- 3.1.0 — 2020-11-03
- 3.0.2 — 2020-09-09
- 3.0.1-1 — 2019-08-19
- 3.0.0 — 2017-07-24
- 1.1.1 — 2016-11-17
- 2.0.0 — 2016-11-15
- 1.1.0 — 2016-08-16
- … 5 more at https://npm.io/package/aes-decrypter/versions

## README

# aes-decrypter

[![Build Status](https://travis-ci.org/videojs/aes-decrypter.svg?branch=master)](https://travis-ci.org/videojs/aes-decrypter)
[![Greenkeeper badge](https://badges.greenkeeper.io/videojs/aes-decrypter.svg)](https://greenkeeper.io/)
[![Slack Status](http://slack.videojs.com/badge.svg)](http://slack.videojs.com)

[![NPM](https://nodei.co/npm/aes-decrypter.png?downloads=true&downloadRank=true)](https://nodei.co/npm/aes-decrypter/)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation

```sh
npm install --save aes-decrypter
```

Also available to install globally:

```sh
npm install --global aes-decrypter
```

The npm installation is preferred, but Bower works, too.

```sh
bower install  --save aes-decrypter
```

## Usage

To include decrypter on your website or npm application, use any of the following methods.
```js
var Decrypter = require('aes-decrypter').Decrypter;
var fs = require('fs');
var keyContent = fs.readFileSync('something.key');
var encryptedBytes = fs.readFileSync('somithing.txt');

// keyContent is a string of the aes-keys content
var keyContent = fs.readFileSync(keyFile);

var view = new DataView(keyContent.buffer);
var key.bytes = new Uint32Array([
  view.getUint32(0),
  view.getUint32(4),
  view.getUint32(8),
  view.getUint32(12)
]);

key.iv = new Uint32Array([
  0, 0, 0, 0
]);

var d = new Decrypter(
  encryptedBytes,
  key.bytes,
  key.iv,
  function(err, decryptedBytes) {
    // err always null
});
```

## [License](LICENSE)

Apache-2.0. Copyright (c) Brightcove, Inc.

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