npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@deephug/encrypt

v2.0.1

Published

数据传输加密工具包

Downloads

6

Readme

数据传输加密工具包

更新日志

切换镜像源

绑定本地 host 文件

10.1.93.111 nexus.wdjky.me

数据包为内网镜像服务

npm config set registry http://nexus.wdjky.me/repository/group-npm/

你可以安装 nrm 管理镜像源

nrm add 863 http://nexus.wdjky.me/repository/group-npm/
nrm use 863

安装

npm install @wonders/encrypt

或者使用 yarn:

yarn add @wonders/encrypt

V1 加密流程

加密工作流程

V1 基础使用

客户端加密过程 请求框架为 axios

import { randomStr, aesEncrypt, pan, dora, getUrlParams, parseRes, backdoor, rsaEncrypt } from '@wonders/encrypt';

我们针对源码进行了敏感词混淆,关键词 pan,dora 都进行脱敏,尽量不要直接使用字符串

直接调用包提供的随机串生成方法

const aesKey = randomStr();
const encryptStr = rsaEncrypt(aesKey);

get 请求入参处理

config.headers[pan] = encryptStr;
let urlPanStr = getUrlParams(config.params);
if (urlPanStr) {
    config.params = {};
    config.params[dora] = aesEncrypt(urlPanStr, aesKey);
}

post 请求入参处理

config.headers[pan] = encryptStr;
if (config.data && JSON.stringify(config.data) != '{}') {
    const data = {};
    data[dora] = aesEncrypt(JSON.stringify(config.data), aesKey);
    config.data = data;
}

开启后门,数据不加密传输,对应的入参也不要加密,否则会有问题

config.headers[backdoor] = true;

解密响应数据

axios(config).then((result) => {
    parseRes(result)
})

V2 加密流程

针对 rsa 公钥只加不解原则,以下是升级后的数据加密流程

待优化加密流程

原先:parseRes(result: AxiosResponse) 变更为:parseRes(result: AxiosResponse, aesKey:string)

解密响应数据

axios(config).then((result) => {
    parseRes(result, aesKey) //使用作用域隔离每次请求的aesKey
})