sqlite pysqlcipher 的安装与简单链接数据库使用 sqlite cracker

SQLCipher

      SQLCipher is a standalone fork of SQLite that adds 256 bit AES encryption of database files and other security features.https://pypi.org/project/pysqlcipher/#files

安装(环境依赖的安装见文尾)

创建一个python 2.7环境

pip install pysqlcipher

使用

      官方https://github.com/leapcode/pysqlcipher给出的数据库连接方式:

from pysqlcipher import dbapi2 as sqlite
conn = sqlite.connect('test.db')
c = conn.cursor()
c.execute("PRAGMA key='test'")
c.execute('''create table stocks (date text, trans text, symbol text, qty real, price real)''')
c.execute("""insert into stocks values ('2006-01-05','BUY','RHAT',100,35.14)""")
conn.commit()
c.close()

数据库****.db

应用的数据库使用的是sqlite3,数据库文件在\Documents\APPname\APP账号\Msg这个路径下,所有的数据库文件都是经过AES加密的,AES的密钥是32位,而且所有数据库文件共用一个密钥,我们需要找到那个AES密钥才能进行解密,然后才能对数据库文件进行操作。 

[https://github.com/chg-hou/EnMicroMsg.db-Password-Cracker](https://github.com/chg-hou/EnMicroMsg.db-Password-Cracker)
[编译安装pysqlcipher3](https://zhuanlan.zhihu.com/p/164917107)
[python自带sqlite模块也可操作数据库](https://www.zkxjob.com/7605)
[用 Python 分析微信群聊记录,是怎样一种体验?](https://blog.youkuaiyun.com/qq_39241986/article/details/105743260?)
[sqlcipher.exe  拼接密码的视频](https://www.bilibili.com/video/BV1st411D7nx)
[使用java拼接密码然后链接数据库](https://www.bilibili.com/read/cv15864412)
[利用数据链接](https://www.52pojie.cn/thread-1084703-1-1.html)
[数据库实体展示](https://github.com/lefex/LefexWork/blob/master/blog/iOS/%E5%AF%BC%E5%87%BA%E5%BE%AE%E4%BF%A1iOS%E6%95%B0%E6%8D%AE%E5%BA%93.md)
[ ](https://zhuanlan.zhihu.com/p/123942610)
[ ](https://toutiao.io/posts/448a29c/preview)

依赖:

在windows下面,需要先安装OpenSSL
https://www.openssl.org/source/
win10 Python3安装pysqlcipher3的问题总结

 ERROR: Command errored out with exit status 1:
  command: 'C:\ProgramData\Anaconda3\envs\sql\python.exe' -u -c 'import sys, se
uptools, tokenize; sys.argv[0] = '"'"'c:\\users\\admini~1\\appdata\\local\\temp
\pip-install-g0lgr2\\pysqlcipher\\setup.py'"'"'; __file__='"'"'c:\\users\\admin
~1\\appdata\\local\\temp\\pip-install-g0lgr2\\pysqlcipher\\setup.py'"'"';f=geta
tr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'
', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist
wheel -d 'c:\users\admini~1\appdata\local\temp\pip-wheel-rfamfp' --python-tag c
27
      cwd: c:\users\admini~1\appdata\local\temp\pip-install-g0lgr2\pysqlcipher\

windows可在Docker中执行:docker pull python:3.7.13或安装WLS

linux下安装

sudo apt-get install python-dev
sudo apt-get install sqlite sqlite3
sudo apt-get install libsqlite3-dev
//pip install lxml
//pip install pillow
//pip install pycrypto
//pip install pymongo
//wget no-check-certificate https://bootstrap.pypa.io/ez_setup.py
//sudo apt-get install gcc
sudo apt-get install openssl
sudo apt-get install libssl-dev

linux 依赖参考此篇文章:https://blog.youkuaiyun.com/u012195899/article/details/52487014

注:后来在docker中发现了这个项目,里边有各种语言的环境,但是没有发现python的

给sqlite数据文件加密
https://github.com/sqlcipher

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值