1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 10:19:24 +02:00
Oinktube/node_modules/pkcs7
Daniel 2a9630258f https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556
Also check the lang in case insensitive
2022-03-14 14:28:38 -03:00
..
bin https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
dist https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
scripts https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
src https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
test https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
CHANGELOG.md https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
CONTRIBUTING.md https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
LICENSE https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
package.json https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00
README.md https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556 2022-03-14 14:28:38 -03:00

pkcs7

Build Status Greenkeeper badge Slack Status

NPM

Add and remove pkcs7-style padding.

Table of Contents generated with DocToc

Getting Started

Install the module with: npm install pkcs7

var pkcs7 = require('pkcs7'), encrypted;
// pad a buffer!
enctcrypted = encrypt(pkcs7.pad(buffer));

// later, you can unpad it:
console.log('the secret is out! ' + pkcs7.unpad(decrypt(encrypted)));

Install with cli command

$ npm install -g pkcs7
$ pkcs7 --help
$ pkcs7 --version

Documentation

PKCS#7 padding a really simple transformation some crytographic algorithms use to ensure the number of input bytes is a multiple of some constant. Here's how it works:

         01 -- if lth mod k = k-1
      02 02 -- if lth mod k = k-2
          .
          .
          .
k k ... k k -- if lth mod k = 0

k is the constant value the encryption algorithm wants your input to be a multiple of. This project assumes k is always sixteen. Not much to it, right? If reading specs is your thing, check out RFC 5652.

Examples

You can run pkcs7 from the command line:

# pad a string generated by echo and the hex dump the result
echo -n "0123456789AB" | pkcs7 | xxd

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 using Grunt.

License

Copyright (c) 2014 Brightcove Licensed under the Apache-2 license.