# NOTICE
We’re archiving Anvil Connect and all related packages. This code is entirely MIT Licensed. You’re free to do with it what you want. That said, we are recommending _**against**_ using it, due to the potential for security issues arising from unmaintained software. For more information, see the announcement at [anvil.io](https://anvil.io).
# W3C Web Cryptography API _(@trust/webcrypto)_
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![Build Status](https://travis-ci.org/anvilresearch/webcrypto.svg?branch=master)](https://travis-ci.org/anvilresearch/webcrypto)
> W3C Web Cryptography API for Node.js
W3C's [Web Cryptography API][webcrypto] defines a standard interface for performing
cryptographic operations in JavaScript, such as key generation, hashing, signing, and
encryption. This package implements the API for Node.js, in order to support universal
crypto-dependent code required by protocols such as [JOSE][jose] and
[OpenID Connect][oidc].
[webcrypto]: https://www.w3.org/TR/WebCryptoAPI/
[jose]: https://datatracker.ietf.org/wg/jose/documents/
[oidc]: http://openid.net/connect/
## Table of Contents
* [Security](#security)
* [Background](#background)
* [Install](#install)
* [Usage](#usage)
* [Develop](#develop)
* [Supported Algorithms](#supported-algorithms)
* [API](#api)
* [Contribute](#contribute)
* [MIT License](#mit-license)
## Security
TBD
## Background
The purpose of this package is to enable development of universal JavaScript
libraries that depend on the availability of cryptographic primitives in order
to implement cryptographic protocols. The long term goal of the project is to
encourage or provide a [native, if not core][wtf] Web Cryptography module.
[wtf]: https://github.com/nodejs/node/issues/2833
## Install
`@trust/webcrypto` requires recent versions of [node][node] and [npm][npm] to run. For key generation operations, it also requires [OpenSSL][openssl] to be installed on the system.
[node]: https://nodejs.org
[npm]: https://www.npmjs.com/
[openssl]: https://www.openssl.org/
```bash
$ npm install @trust/webcrypto --save
```
### Not for use in Webpack
This library is not for use in Webpack.
The whole point of this library is that it's an exact duplicate of the browser's WebCrypto API,
for the server side.
For Webpacked web applications,
you don't need it (and can't use it).
If this module is transitively included by another dependency,
you have to exclude it by adding it to the [`externals` section in the Webpack config](https://webpack.js.org/configuration/externals/),
such as this:
```
externals: {
'@trust/webcrypto': 'crypto'
}
```
## Usage
```javascript
const crypto = require('@trust/webcrypto')
```
## Develop
### Install
```bash
$ git clone git@github.com:anvilresearch/webcrypto.git
$ cd webcrypto
$ npm install
```
### Test
```bash
$ npm test
```
## Supported Algorithms
| Algorithm name | encrypt | decrypt | sign | verify | digest | generateKey | deriveKey | deriveBits | importKey | exportKey | wrapKey | unwrapKey |
|------------------|---|---|---|---|---|---|---|---|---|---|---|---|
|RSASSA-PKCS1-v1_5 | | | ✔ | ✔ | | ✔ | | | ✔ | ✔ | | |
|RSA-PSS | | | ✔ | ✔ | | ✔ | | | ✔ | ✔ | | |
|RSA-OAEP | ✔ | ✔ | | | | ✔ | | | ✔ | ✔ | ✔ | ✔ |
|ECDSA | | | ⚐ | ⚐ | | ⚐ | | | ✔ | ✔ | | |
|EDDSA | | | ⚐ | ⚐ | | ⚐ | | | ✔ | ✔ | | |
|ECDH | | | | | | _ | _ | _ | _ | _ | | |
|AES-CTR | ⚐ | ⚐ | | | | ✔ | | | ✔ | ✔ | ✔ | ✔ |
|AES-CBC | ✔ | ✔ | | | | ✔ | | | ✔ | ✔ | ✔ | ✔ |
|AES-GCM | ✔ | ✔ | | | | ✔ | | | ✔ | ✔ | ✔ | ✔ |
|AES-KW | | | | | | ✔ | | | ✔ | ✔ | ✔ | ✔ |
|HMAC | | | ✔ | ✔ | | ✔ | | | ✔ | ✔ | | |
|SHA-1 | | | | | ✔ | | | | | | | |
|SHA-256 | | | | | ✔ | | | | | | | |
|SHA-384 | | | | | ✔ | | | | | | | |
|SHA-512 | | | | | ✔ | | | | | | | |
|HKDF | | | | | | | _ | _ | _ | | | |
|PBKDF2 | | | | | | | _ | _ | _ | | | |
Key:
` ✔ ` Implemented
` _ ` Currently not implemented
` ⚐ ` Partially implemented, only certain paramaters supported.
## Partial Support
Only the following paramaters are supported for the corresponding algorithm.
| Algorithm name | Supported paramater |
| -------------- | ------------------- |
| ECDSA | `K-256 (secp256k1)`, `P-256`, `P-384`, `P-512` |
| EDDSA | `ed25519` |
| AES-CTR | `sha-1` |
## API
See [W3C Web Cryptography API][webcrypto] specification and diafygi's [webcrypto-examples][examples].
[examples]: https://github.com/diafygi/webcrypto-examples
## Contribute
### Issues
* Please file [issues](https://github.com/anvilresearch/webcrypto/issues) :)
* When writing a bug report, include relevant details such as platform, version, relevant data, and stack traces
* Ensure to check for existing issues before opening new ones
* Read the documentation before asking questions
* It is strongly recommended to open an issue before hacking and submitting a PR
* We reserve the right to close an issue for excessive bikeshedding
### Pull requests
#### Policy
* We're not presently accepting *unsolicited* pull requests
* Create an issue to discuss proposed features before submitting a pull request
* Create an issue to propose changes of code style or introduce new tooling
* Ensure your work is harmonious with the overall direction of the project
* Ensure your work does not duplicate existing effort
* Keep the scope compact; avoid PRs with more than one feature or fix
* Code review with maintainers is required before any merging of pull requests
* New code must respect the style guide and overall architecture of the project
* Be prepared to defend your work
#### Style guide
* ES6
* Standard JavaScript
* jsdocs
#### Code reviews
* required before merging PRs
* reviewers MUST run and test the code under review
### Collaborating
#### Weekly project meeting
* Thursdays from 1:00 PM to 2:00 Eastern US time at [TBD]
* Join remotely with Google Hangouts
#### Pair programming
* Required for new contributors
* Work directly with one or more members of the core development team
### Code of conduct
* @trust/webcrypto follows the [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/) Code of Conduct.
### Contributors
* Christian Smith [@christiansmith](https://github.com/christiansmith)
* Dmitri Zagidulin [@dmitrizagidulin](https://github.com/dmitrizagidulin)
* Greg Linklater [@EternalDeiwos](https://github.com/EternalDeiwos)
* JC Bailey [@thelunararmy](https://github.com/thelunararmy)
* Ioan Budea [@johnny90](https://github.com/johnny90)
* Abdulrahman Alotaibi [@adminq80](https://github.com/adminq80)
* Linus Unnebäck [@LinusU](https://github.com/LinusU)
* Len Boyette [@kevlened](https://github.com/kevlened)
* Tom Bonner [@Glitch0011](https://github.com/Glitch0011)
## MIT License
Copyright (c) 2016 Anvil Research, Inc.
没有合适的资源?快使用搜索试试~ 我知道了~
用于Node.js的W3CWeb加密API.zip
共102个文件
js:92个
json:3个
ts:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 118 浏览量
2023-03-28
13:44:44
上传
评论
收藏 140KB ZIP 举报
温馨提示
用于Node.js的W3CWeb加密API.zip
资源推荐
资源详情
资源评论
收起资源包目录
用于Node.js的W3CWeb加密API.zip (102个子文件)
.editorconfig 270B
.gitignore 911B
SubtleCryptoSpec.js 37KB
RSASSA-PKCS1-v1_5_Spec.js 30KB
RSA-PSSSpec.js 30KB
RSA-OAEPspec.js 22KB
AES-GCMSpec.js 19KB
EDDSASpec.js 19KB
AES-CTRSpec.js 18KB
AES-KWSpec.js 16KB
AES-CBCSpec.js 16KB
SubtleCrypto.js 15KB
ECDSASpec.js 15KB
EDDSA.js 14KB
RSA-OAEP.js 13KB
AES-GCM.js 13KB
AES-KW.js 11KB
ECDSA.js 10KB
RSA-PSS.js 10KB
AES-CTR.js 10KB
RSASSA-PKCS1-v1_5.js 10KB
AES-CBC.js 10KB
HMACSpec.js 9KB
EcdsaKeyPairsForTesting.js 7KB
HMAC.js 7KB
index.js 7KB
RsaKeyPairForPSSTesting.js 5KB
RsaKeyPairForTesting.js 4KB
SupportedAlgorithmsSpec.js 4KB
SHASpec.js 4KB
SupportedAlgorithms.js 3KB
CryptoKey.js 2KB
Crypto.js 2KB
SHA.js 1KB
RegisteredAlgorithmsSpec.js 1KB
recognizedKeyUsagesSpec.js 1KB
AlgorithmSpec.js 1019B
RsaHashedKeyAlgorithmSpec.js 992B
RsaKeyAlgorithm.js 974B
RsaHashedKeyAlgorithm.js 820B
CryptoSpec.js 810B
KeyAlgorithmSpec.js 762B
RsaKeyGenParams.js 701B
EcKeyAlgorithm.js 679B
Algorithm.js 635B
Algorithm.js 635B
RsaHashedKeyGenParams.js 578B
recognizedKeyUsages.js 564B
HmacKeyAlgorithmSpec.js 555B
HmacKeyAlgorithm.js 541B
RegisteredAlgorithms.js 495B
index.js 462B
ShaKeyAlgorithmSpec.js 462B
KeyAlgorithm.js 440B
CurrentlyNotSupportedError.js 415B
KeyFormatNotSupportedError.js 354B
AesKeyAlgorithm.js 312B
EcKeyGenParams.js 301B
ShaKeyAlgorithm.js 284B
EcKeyImportParams.js 278B
RsaHashedImportParams.js 276B
EcdhKeyDeriveParams.js 257B
AesDerivedKeyParams.js 257B
DhKeyAlgorithm.js 251B
DhImportKeyParams.js 251B
DhKeyDeriveParams.js 251B
HmacKeyGenParams.js 248B
HmacImportParams.js 248B
AesKeyGenParams.js 245B
DhKeyGenParams.js 242B
RsaOaepParams.js 239B
AesCmacParams.js 239B
HkdfCtrParams.js 239B
AesCfbParams.js 237B
AesCbcParams.js 236B
ConcatParams.js 236B
AesGcmParams.js 236B
RsaPssParams.js 236B
Pbkdf2Params.js 236B
AesCtrParams.js 236B
EcdsaParams.js 233B
NotSupportedError.js 220B
CryptoKeyPair.js 220B
QuotaExceededError.js 177B
InvalidAccessError.js 177B
JsonWebKey.js 177B
TypeMismatchError.js 174B
OperationError.js 165B
DataError.js 150B
index.js 65B
AES-KW.js 0B
CryptoKeySpec.js 0B
JsonWebKeySpec.js 0B
CryptoKeyPairSpec.js 0B
package-lock.json 143KB
package.json 989B
jsdoc.json 182B
LICENSE 1KB
README.md 7KB
mocha.opts 20B
共 102 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 使用 C 语言实现的计算非负整数的阶乘
- 2011-2021最新版本北京大学数字普惠金融指数(PKU-DFIIC).xlsx
- 县域数字乡村指数2018-2020(1).xlsx
- Docker容器配置进阶
- tensorflow-gpu-2.7.4-cp37-cp37m-manylinux2010-x86-64.whl
- 多段线、 圆、弧转多段线(仅我可见)
- tensorflow-2.7.2-cp38-cp38-manylinux2010-x86-64.whl
- 李慧琴C语言基础部分.zip
- yeyue-p8Yi4-ve4a83792.apk
- tensorflow-gpu-2.7.3-cp38-cp38-manylinux2010-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功