pkcs7

WebJar for pkcs7

License

License

GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

pkcs7
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

pkcs7
WebJar for pkcs7
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/brightcove/pkcs7

Download pkcs7

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/pkcs7/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>pkcs7</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/pkcs7/
implementation 'org.webjars.npm:pkcs7:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.npm/pkcs7/
implementation ("org.webjars.npm:pkcs7:1.0.4")
'org.webjars.npm:pkcs7:jar:1.0.4'
<dependency org="org.webjars.npm" name="pkcs7" rev="1.0.4">
  <artifact name="pkcs7" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='pkcs7', version='1.0.4')
)
libraryDependencies += "org.webjars.npm" % "pkcs7" % "1.0.4"
[org.webjars.npm/pkcs7 "1.0.4"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : babel__runtime jar [7.5.5,8)

Project Modules

There are no modules declared in this project.

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.

org.webjars.npm

Brightcove

The leading online video hosting platform and online video player solution.

Versions

Version
1.0.4
1.0.3
1.0.2