在python中加密的文件或数据库 [英] Encrypted file or db in python

查看:332
本文介绍了在python中加密的文件或数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个sqlite3数据库,我插入/从python中选择。该应用程序很好,但我想调整它,所以没有人可以从DB读取没有密码。我如何在python中这样做?注意我不知道从哪里开始。

解决方案

可以使用SQLCipher。



http://sqlcipher.net/



SQLite的开源完整数据库加密



SQLCipher是一个SQLite扩展,提供数据库文件的透明256位AES加密。页面在写入磁盘之前被加密,并在读回时被解密。由于占地面积小,性能出色,因此非常适合保护嵌入式应用数据库,非常适合移动开发。


  1. 对于许多操作,
    加密只有5-15%的开销

  2. 数据库文件中的100%的数据被加密使用良好的安全性
    做法(CBC模式,密钥派生)

  3. 零配置和应用级密码学广泛的平台

  4. 支持:适用于C / C ++,Obj-C,QT,Win32 /。 NET,Java,Python,
    Ruby等,Windows,Linux,iPhone / iOS ...


I have a sqlite3 db which i insert/select from in python. The app works great but i want to tweak it so no one can read from the DB without a password. How can i do this in python? note i have no idea where to start.

解决方案

You can use SQLCipher.

http://sqlcipher.net/

Open Source Full Database Encryption for SQLite

SQLCipher is an SQLite extension that provides transparent 256-bit AES encryption of database files. Pages are encrypted before being written to disk and are decrypted when read back. Due to the small footprint and great performance it’s ideal for protecting embedded application databases and is well suited for mobile development.

  1. Blazing fast performance with as little as 5-15% overhead for encryption on many operations
  2. 100% of data in the database file is encrypted Uses good security practices (CBC mode, key derivation)
  3. Zero-configuration and application level cryptography Broad platform
  4. support: works with C/C++, Obj-C, QT, Win32/.NET, Java, Python, Ruby, etc on Windows, Linux, iPhone/iOS…

这篇关于在python中加密的文件或数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆