https://github.com/videojs/aes-decrypter
https://github.com/videojs/aes-decrypter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/videojs/aes-decrypter
- Owner: videojs
- License: other
- Created: 2016-06-15T19:58:49.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-08-22T09:29:08.000Z (almost 2 years ago)
- Last Synced: 2025-03-11T15:51:14.767Z (over 1 year ago)
- Language: JavaScript
- Size: 1.09 MB
- Stars: 36
- Watchers: 18
- Forks: 16
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-video - videojs/aes-decrypter - Contribute to videojs/aes-decrypter development by creating an account on GitHub. (DRM, Security & Content Protection / Encryption Tools for Streaming)
README
# aes-decrypter
[](https://travis-ci.org/videojs/aes-decrypter)
[](https://greenkeeper.io/)
[](http://slack.videojs.com)
[](https://nodei.co/npm/aes-decrypter/)
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)
## 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.