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

@hbworld/ad-sdks

v0.0.1

Published

高级加密运行时库,支持代码压缩、加密和安全执行

Readme

Encrypted Runtime Advanced

一个高级的代码加密运行时库,用于保护敏感的业务逻辑代码。通过压缩、加密和安全执行机制,确保您的核心代码不被轻易查看或篡改。

特性

  • 强加密保护:使用AES-256-CBC加密算法保护源代码
  • 高效压缩:使用GZIP压缩减小文件体积
  • 代码混淆:多层次代码混淆,包括控制流扁平化、死代码注入和字符串加密
  • 代码压缩:使用Terser进行高效代码压缩
  • 高级混淆:自定义混淆技术,包括字符串编码、诱饵代码和反调试机制
  • 完整性验证:通过哈希校验确保代码未被篡改
  • 配置灵活:支持环境变量和命令行选项
  • 内存缓存:优化性能,避免重复解密
  • 详细日志:彩色日志输出,清晰展示构建过程
  • 随机密钥:支持随机密钥生成(开发环境)

安装

npm install @hbworld/ad-sdk

使用方法

基本使用

高级配置

命令行选项

node build-encrypt.js [选项]

可用选项:

  • --no-obfuscate:禁用代码混淆
  • --no-minify:禁用代码压缩
  • --compression-level N:设置压缩级别 (0-9, 默认为9)
  • --verbose:启用详细日志
  • --quiet:禁用详细日志
  • --help:显示帮助信息

环境变量

您可以通过环境变量自定义加密和解密行为:

# 构建时配置
SRC_FILE_PATH=/path/to/source.js      # 源代码文件路径
DIST_DIR_PATH=/path/to/output         # 输出目录路径
USE_RANDOM_KEY=true                   # 使用随机密钥
COMPRESSION_LEVEL=9                   # 压缩级别
OBFUSCATE=true                        # 启用代码混淆
MINIFY=true                           # 启用代码压缩
VERBOSE=true                          # 显示详细日志

# 运行时配置
VALIDATE_INTEGRITY=false              # 禁用完整性验证
IGNORE_INTEGRITY_FAILURE=true         # 忽略完整性验证失败
CACHE_ENABLED=true                    # 启用内存缓存
IGNORE_INTEGRITY_CHECK=true           # 忽略完整性检查(兼容旧版本)

安全建议

  1. 密钥管理:不要在代码中硬编码密钥,使用环境变量或安全的密钥管理服务
  2. 定期更新:定期更新密钥和加密算法
  3. 多层防御:将代码加密作为整体安全策略的一部分,不要仅依赖于此
  4. 限制访问:限制对加密密钥和原始源代码的访问

注意事项

  • 此库主要用于保护知识产权和敏感业务逻辑,不适用于存储用户密码等高敏感数据
  • 任何客户端代码最终都可能被逆向工程,此库提供的是增加逆向工程难度的方法

许可证

MIT