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

kveil

v0.3.0

Published

防 AI 密钥窃取工具 - 将密钥加密存储在二进制文件中

Readme

kveil

防 AI 密钥窃取工具 - 将密钥加密存储在二进制文件中,防止 AI 爬虫读取代码库时窃取敏感信息。

⚠️ 迁移指南 (v0.2.0 -> v0.3.0)

BREAKING CHANGE: 默认配置目录已从 .kveil 重命名为 .kvbin

请手动重命名项目中的目录:

mv .kveil .kvbin

核心原理

  • bin 文件存储:密钥加密后存储在二进制文件中,AI 爬虫通常不会读取二进制文件
  • AES-256-GCM 加密:使用强加密算法保护密钥
  • XOR 编码主密钥:主密钥经过 XOR 编码后存储在 bin 文件头部

快速开始

1. 初始化项目

kveil init

生成:

  • .kvbin/secrets.bin - 加密的密钥存储文件
  • .kvbin/config.yaml - 密钥声明配置

2. 添加密钥

kveil add mi_api_key "sk-1234567890abcdef"

3. 查看密钥

# 查看所有密钥的明文和密文
kveil show -l

# 查看指定密钥的明文
kveil show mi_api_key

4. 检查完整性

kveil check
kveil list

密钥管理

删除密钥

kveil remove mi_api_key

secrets.binconfig.yaml 中删除指定密钥。

重置单个密钥值

kveil reset mi_api_key "new-sk-0987654321fedcba"

更新指定密钥的值(使用相同的主密钥重新加密)。

更换主密钥

# 自动生成新主密钥
kveil rekey

# 指定新主密钥(必须 16 位)
kveil rekey --key "ABCDEFGHIJ123456"

使用场景:

  • 主密钥可能泄露时
  • 定期轮换密钥以提高安全性
  • 团队成员变更后的安全加固

注意事项:

  • 旧主密钥将失效
  • 所有使用旧主密钥的运行时库需要同步更新
  • 新主密钥需要安全分发给团队成员

运行时库集成

Flutter

pubspec.yaml

dependencies:
  kveil:
    path: path/to/kveil/packages/flutter

代码使用

import 'package:kveil/kveil.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Kveil.init();
  final apiKey = Kveil.get('mi_api_key');
  runApp(MyApp());
}

Web/React

安装

npm install kveil-web

配置 - 复制 bin 文件到 public 目录:

cp .kvbin/secrets.bin public/.kvbin/secrets.bin

代码使用

import { Kveil } from 'kveil-web';

await Kveil.init('/.kvbin/secrets.bin');
const apiKey = Kveil.get('mi_api_key');

安全说明

防护的场景

✅ AI 爬虫(不解析二进制文件) ✅ 代码审查(看不到明文密钥)

不防护的场景

❌ 专业逆向工程 ❌ 运行时攻击 ❌ 黑客攻击

完整文档

https://github.com/yourusername/kveil

许可证

MIT