You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
林华焜
b6f8f922cf
|
4 years ago | |
---|---|---|
.. | ||
dist | 4 years ago | |
node_modules | 4 years ago | |
scripts | 4 years ago | |
src | 4 years ago | |
test | 4 years ago | |
CHANGELOG.md | 4 years ago | |
CONTRIBUTING.md | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
index.html | 4 years ago | |
package.json | 4 years ago |
README.md
aes-decrypter
Installation
npm install --save aes-decrypter
Also available to install globally:
npm install --global aes-decrypter
The npm installation is preferred, but Bower works, too.
bower install --save aes-decrypter
Usage
To include decrypter on your website or npm application, use any of the following methods.
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
Apache-2.0. Copyright (c) Brightcove, Inc.