linux配置数据库密码加密,Linux安装编译SQLCipher,对sqlite数据库加密、解密、修改、去掉密码操作-Go语言中文社区...

SQLCipher主要API

PRAGMA key

Example 1: Passphrase with Key Derivation

sqlite> PRAGMAkey = 'passphrase';

Example 2: Raw Key Data (Without KeyDerivation)

sqlite> PRAGMA key = "x'2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99'";

PRAGMA cipher

sqlite> PRAGMA key = 'blue valentines';

sqlite> PRAGMA cipher = 'aes-256-cfb';

PRAGMA kdf_iter

sqlite> PRAGMA key = 'blue valentines';

sqlite> PRAGMA kdf_iter = '10000';

PRAGMA cipher_default_kdf_iter

./sqlcipher sqlcipher2.0.db

sqlite> PRAGMA cipher_default_kdf_iter = 4000;

sqlite> PRAGMA key = 's3cr37';

PRAGMA cipher_page_size

sqlite> PRAGMA KEY = 'testkey';

sqlite> PRAGMA cipher_page_size = 4096;

PRAGMA cipher_default_page_size

$ ./sqlcipher foo.db

sqlite> PRAGMA key = 'foo';

sqlite> PRAGMA cipher_page_size = 4096;

sqlite> CREATE TABLE t1(a,b);

sqlite> INSERT INTO t1(a,b) values('one for the money', 'two for the show');

sqlite> .q

$ ./sqlcipher bar.db

sqlite> PRAGMA ciphe

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值