Self-contained Go sqlite3 driver with an AES-256 encrypted sqlite3 database
Switch branches/tags
Nothing to show
Clone or download
frankbraun remove unnecssary flag
This pulls in the pthreads library on Windows.
It is not necessary to make libtomcrypt thread safe, a mutex is already
applied in sqlcipher.
Latest commit f799951 Sep 20, 2017
Permalink
Failed to load latest commit information.
_example/simple update code from github.com/mattn/go-sqlite3 Apr 26, 2017
sqlite3_test update code from github.com/mattn/go-sqlite3 Apr 26, 2017
.travis.yml bump go version for tests Apr 24, 2017
LICENSE add code Apr 28, 2015
MAINTENANCE add missing pragmas May 8, 2017
README.md document sqlite3.IsEncrypted() May 8, 2017
aes.c add code Apr 28, 2015
aes_tab.h
burn_stack.c
cbc_decrypt.c
cbc_done.c add code Apr 28, 2015
cbc_encrypt.c add code Apr 28, 2015
cbc_start.c add code Apr 28, 2015
crypt_argchk.c
crypt_cipher_descriptor.c
crypt_cipher_is_valid.c
crypt_find_cipher.c add code Apr 28, 2015
crypt_find_hash.c add code Apr 28, 2015
crypt_hash_descriptor.c add code Apr 28, 2015
crypt_hash_is_valid.c
crypt_prng_descriptor.c add code Apr 28, 2015
crypt_register_cipher.c add code Apr 28, 2015
crypt_register_hash.c
crypt_register_prng.c add code Apr 28, 2015
error.go update code from github.com/mattn/go-sqlite3 Apr 26, 2017
error_test.go
flags.go remove unnecssary flag Sep 20, 2017
fortuna.c add code Apr 28, 2015
hash_memory.c add code Apr 28, 2015
hmac_done.c add code Apr 28, 2015
hmac_init.c
hmac_memory.c add code Apr 28, 2015
hmac_process.c add code Apr 28, 2015
pkcs_5_2.c
sha1.c
sha256.c add code Apr 28, 2015
sqlcipher.go document sqlite3.IsEncrypted() May 8, 2017
sqlcipher_test.go add ExampleIsEncrypted() May 9, 2017
sqlite3.c
sqlite3.go add missing pragmas May 8, 2017
sqlite3.h update code from github.com/sqlcipher/sqlcipher Apr 24, 2017
sqlite3_other.go update code from github.com/mattn/go-sqlite3 Apr 29, 2015
sqlite3_test.go update code from github.com/mattn/go-sqlite3 Apr 26, 2017
sqlite3_windows.go update code from github.com/mattn/go-sqlite3 Apr 26, 2017
tomcrypt.h add code Apr 28, 2015
tomcrypt_argchk.h add code Apr 28, 2015
tomcrypt_cfg.h add code Apr 28, 2015
tomcrypt_cipher.h add code Apr 28, 2015
tomcrypt_custom.h add code Apr 28, 2015
tomcrypt_hash.h add code Apr 28, 2015
tomcrypt_mac.h add code Apr 28, 2015
tomcrypt_macros.h add code Apr 28, 2015
tomcrypt_math.h add code Apr 28, 2015
tomcrypt_misc.h add code Apr 28, 2015
tomcrypt_pk.h add code Apr 28, 2015
tomcrypt_pkcs.h
tomcrypt_prng.h add code Apr 28, 2015
track_libtomcrypt.sh
zeromem.c add code Apr 28, 2015

README.md

go-sqlcipher GoDoc Build Status

Description

Self-contained Go sqlite3 driver with an AES-256 encrypted sqlite3 database conforming to the built-in database/sql interface. It is based on:

SQLite itself is part of SQLCipher.

Installation

This package can be installed with the go get command:

go get github.com/mutecomm/go-sqlcipher

Documentation

To create and open encrypted database files use the following DSN parameters:

key := "2DD29CA851E7B56E4697B0E1F08507293D761A05CE4D1B628663F411A8086D99"
dbname := fmt.Sprintf("db?_pragma_key=x'%s'&_pragma_cipher_page_size=4096", key)
db, _ := sql.Open("sqlite3", dbname)

_pragma_key is the hex encoded 32 byte key (must be 64 characters long). _pragma_cipher_page_size is the page size of the encrypted database (set if you want a different value than the default 1024 bytes).

API documentation can be found here: http://godoc.org/github.com/mutecomm/go-sqlcipher

Use the function sqlite3.IsEncrypted() to check whether a database file is encrypted or not.

Examples can be found under the ./_example directory

License

The code of the originating packages is covered by their respective licenses. See LICENSE file for details.