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

sqlcipher

v1.1.1

Published

SQLCipher is a sqlite3 with encryption based on openssl(SQLCipher 是一个基于openssl加密功能sqlite3)

Readme

sqlcipher

sqlcipher 是一个基于openssl加密功能sqlite3。形式上增加一些与加密功能相关sql语句;本质上是一个经过重新编译的sqlite3,不破坏原有功能,仅仅增添了加密特性。

简介

SQLCipher是开源SQLite的一个扩展,此处不是作为SQLite插件,而是指扩展其功能,扩展sqlite API,因为SQLCipher需要重新编译SQLite,最终生成一个集成加密功能的node_sqlit3.nodenode文件。SQLCipher对整个数据库文件加密。SQLCipher安装不需要复杂的配置环境,一般系统有npm就可以针对一些环境进行安装,在过程中会自动安装构建的依赖项。与加密功能的sql语句往往放置最前面,一般是连接数据库之后,就执行这些语句。

支持平台

  • C/C++
  • Obj-C
  • QT
  • Win32/.NET
  • Java
  • Python
  • Ruby
  • Linux
  • Mac OS X
  • iPhone/IOS
  • Android
  • Xamarin.IOS
  • Xamarin.Android
  • Electron

用法

var SQLite3 = require('sqlcipher').verbose();
var sqlite = new SQLite3.Database('./test-win.db');

sqlite.run("pragma key = 'secret'");
sqlite.run("pragma cipher = 'aes-256-cbc'");//optional, default cipher be eqaul to 'aes-256-cbc'

注意:sqlcipher该插件是在sqlite3的基础上增添了加密功能。因此,使用sqlcipher可以对数据库文件进行加密或不加密。如果要对数据库文件进行加密,则连接(创建)数据库文件后,第一条sql语句必须是pragma key = '...',否则将会出现意想不到的错误。

安装

npm install sqlcipher 

通过运行以上命令,将会根据系统的环境编译出相应(系统下node版本以及node位数)的sqlciher。默认支持以下三种系统环境。

  • windows
  • mac
  • linux

通过携带参数可以在指定环境下进行编译。特定环境安装

npm install sqlcipher --target=`目标运行环境版本号` --target_arch=`目标运行环境位数` --dist-url=`目标运行环境下载地址` --runtime=`目标运行环境`

加密算法

sqlcipher基于openssl加密库,支持多种加密算法,在实际开发中可以使用默认算法aes-256-cbc或者在支持的加密算法中选择其中某一个。

  • aes-128-cbc
  • aes-192-cfb
  • aes-256-cbc(默认)
  • cast
  • rc4

API

sqlcipher 常用api有指定加密秘钥、指定加密算法、更换秘钥等。当然,如果需要改善加密环境下的sqlite性能,有更详细的api(即sql语句)去优化项目。

1.加密秘钥

pragma key = 'secret';

2.加密算法

pragma cipher = 'aes-128-cbc';

3.更换秘钥

pragma rekey = 'aes-128-cbc';