Skip to main content

Python 3 bindings for SQLCipher with SQLite statically linked

Project description

pysqlcipher3static

This is a fork of pysqlcipher3 that includes statically linked binary wheel distributions to make it easier to install.

Install with:

pip install pysqlcipher3static

Note: this project is no longer being actively maintained. Security vulnerabilities may exist in this code. Use at your own risk.

This library is a fork of pysqlcipher targeted for use with Python 3. It is still in the beta state, although this library contains minimal new code and instead heavily pulls from the core Python sqlite source code while linking against libsqlcipher.

  • Small modifications for static build (c) 2024 Chris Arderne
  • Python 3 packaging for SQLCipher (c) 2015 David Riggleman
  • Packaging for SQLCipher (c) 2013-2014 Kali Kaneko
  • Original code (c) 2004-2007 Gerhard Häring

Usage

You have to pass the PRAGMA key before doing any operations::

from pysqlcipher3 import dbapi2 as sqlite
conn = sqlite.connect('test.db')
c = conn.cursor()
c.execute("PRAGMA key='password'")
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()

Windows build

Follow the same instructions as above except for the following:

  1. Make sure that you are using OpenSSL-Win64
  2. Set the PATH to the Win64 environment
  3. Copy the OpenSSL folder
  4. Build the amalgamation and install with the latest Python x64

SQLCipher compatibility issues

The encryption has default compatibility with the SQLCipher version installed on your machine. You have to execute PRAGMA cipher_compatibility = 3 before doing any operations on a database encrypted with SQLCipher version 3 when a newer version is installed. Keep in mind, you have to add PRAGMA cipher_compatibility after PRAGMA key::

from pysqlcipher3 import dbapi2 as sqlite
conn = sqlite.connect('test.db')
c = conn.cursor()
c.execute("PRAGMA key='password'")
c.execute("PRAGMA cipher_compatibility = 3")
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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysqlcipher3static-2.0.1.tar.gz (2.6 MB view details)

Uploaded Source

Built Distributions

pysqlcipher3static-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pysqlcipher3static-2.0.1-cp312-cp312-macosx_14_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

pysqlcipher3static-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.5 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pysqlcipher3static-2.0.1-cp311-cp311-macosx_14_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

pysqlcipher3static-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pysqlcipher3static-2.0.1-cp310-cp310-macosx_14_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

pysqlcipher3static-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pysqlcipher3static-2.0.1-cp39-cp39-macosx_14_0_arm64.whl (5.5 MB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

File details

Details for the file pysqlcipher3static-2.0.1.tar.gz.

File metadata

  • Download URL: pysqlcipher3static-2.0.1.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for pysqlcipher3static-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0f5d17766cd0427b3d5288572f9dc6594fed02cbef5562144381fb5dcab37697
MD5 a5975c77e6df5f9a08ff10880a6538e9
BLAKE2b-256 e7ecde7e9c3a4ffb0c7e9c6f678c3ea14e1c26bbb6bdc824f9adfcc07dfa8786

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6009cef15300dd58033e54ce1d2d0a7b0c8f552d116380aa4adb72a9aa766905
MD5 cd2502729ddffdd3f05efc6638b77fd6
BLAKE2b-256 26fdc3b57e9f1e258973d5fbb1a6b3cc9e6e2c8c414c142a8824d09ebe08e514

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 dafb5202f17197c90f25c7129f3bee3cd1e38b0baabcd376c2cab8be6086bb81
MD5 34dc7b04101f3259db5dc6f9f65bde4b
BLAKE2b-256 87f43d55d97e55659a64225dfae0408a0a40075dd842f9359f098fd532b19c70

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 66e7231e05229627ac311b89b1d6d1288c3a105e2d7bae2cf45bb5163713a78a
MD5 37bed95680cadcb3e2af0d7894a12525
BLAKE2b-256 117a836b844bacfe1be82f6f0d2074801440a474b6711e065ec6ea19d53b19c8

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 547383eec98616c6ffb7e0edb07cf88066c975e6c43819721c22a1cefd07fb13
MD5 d44d6558513b5a566daee9125f3552e5
BLAKE2b-256 700a9531bf336c3d288980ea83982b9c993988bae919c50e365bce6dad908227

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ac861f3e1cc1131321cbed0c32577b9529a54db861c659d5cd031989a0c09d69
MD5 0ae157b8ecc05f045f13794f5584de60
BLAKE2b-256 3ccc22312e81fd0db85dc818a3c3cfe568eb3357718c5922cb9e451bb4f0c0a4

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 06fe2929c0b96aa8ab9bc738d7a58a6aef4a34e652ae4ca9f604d6f825342fb5
MD5 139dc3ea48b2fdbbe6fff8b439b956b6
BLAKE2b-256 5fd6b6d7c7f85fa22387c3dcbf0d2bdc2580a29d4043e9e0fce9d1a802b1df95

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 325fb224eaffbb010c09e27f5eeef3fd35dc1c099d662a719c333f9beaa414cd
MD5 075afefc52606f1807b156102d843875
BLAKE2b-256 d72667ac6885b38f4cc0319c62dcacb446f2fc54a78c3513dffa3eaba802dfe1

See more details on using hashes here.

File details

Details for the file pysqlcipher3static-2.0.1-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for pysqlcipher3static-2.0.1-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 14861b79a9dc522e19cf9da9a891511ba7647db730c78fa8c3e6181ac19c04d9
MD5 87dea49d63341dbd134aae367fe88da1
BLAKE2b-256 1a1bf711c64252851fa48cfde6bd37769545bcbdfb00f8300925842e2358a07f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page