Self-contained Go sqlite3 driver with an AES-256 encrypted sqlite3 database
Go to file
Frank Braun 34287a64fb Merge pull request #3 from nkbai/master
build error on windows because of pthread
2016-07-01 14:27:31 +00:00
_example/simple update code from github.com/mattn/go-sqlite3 2015-09-13 16:28:51 +02:00
sqlite3_test update code from github.com/mattn/go-sqlite3 2015-11-29 22:21:55 +00:00
.travis.yml switch test setup to gocheck 2016-02-02 23:47:42 +00:00
LICENSE add code 2015-04-29 01:56:53 +02:00
MAINTENANCE update code from github.com/mattn/go-sqlite3 2015-11-29 22:21:55 +00:00
README.md switch test setup to gocheck 2016-02-02 23:47:42 +00:00
aes.c add code 2015-04-29 01:56:53 +02:00
aes_tab.h add code 2015-04-29 01:56:53 +02:00
burn_stack.c add code 2015-04-29 01:56:53 +02:00
cbc_decrypt.c add code 2015-04-29 01:56:53 +02:00
cbc_done.c add code 2015-04-29 01:56:53 +02:00
cbc_encrypt.c add code 2015-04-29 01:56:53 +02:00
cbc_start.c add code 2015-04-29 01:56:53 +02:00
crypt_argchk.c add code 2015-04-29 01:56:53 +02:00
crypt_cipher_descriptor.c add code 2015-04-29 01:56:53 +02:00
crypt_cipher_is_valid.c add code 2015-04-29 01:56:53 +02:00
crypt_find_cipher.c add code 2015-04-29 01:56:53 +02:00
crypt_find_hash.c add code 2015-04-29 01:56:53 +02:00
crypt_hash_descriptor.c add code 2015-04-29 01:56:53 +02:00
crypt_hash_is_valid.c add code 2015-04-29 01:56:53 +02:00
crypt_prng_descriptor.c add code 2015-04-29 01:56:53 +02:00
crypt_register_cipher.c add code 2015-04-29 01:56:53 +02:00
crypt_register_hash.c add code 2015-04-29 01:56:53 +02:00
crypt_register_prng.c add code 2015-04-29 01:56:53 +02:00
error.go add code 2015-04-29 01:56:53 +02:00
error_test.go update code from github.com/mattn/go-sqlite3 2015-04-29 02:10:36 +02:00
flags.go disable anything "not portable" in libtomcrypt 2015-11-03 04:33:15 +00:00
fortuna.c add code 2015-04-29 01:56:53 +02:00
hash_memory.c add code 2015-04-29 01:56:53 +02:00
hmac_done.c add code 2015-04-29 01:56:53 +02:00
hmac_init.c add code 2015-04-29 01:56:53 +02:00
hmac_memory.c add code 2015-04-29 01:56:53 +02:00
hmac_process.c add code 2015-04-29 01:56:53 +02:00
pkcs_5_2.c add code 2015-04-29 01:56:53 +02:00
sha1.c add code 2015-04-29 01:56:53 +02:00
sha256.c add code 2015-04-29 01:56:53 +02:00
sqlcipher_test.go make _pragma_key more generic 2015-11-30 01:00:07 +00:00
sqlite3.c update code from github.com/sqlcipher/sqlcipher 2015-09-13 16:31:55 +02:00
sqlite3.go add support for dsn _pragma_foreign_keys 2015-11-30 01:04:21 +00:00
sqlite3.h update code from github.com/sqlcipher/sqlcipher 2015-09-13 16:31:55 +02:00
sqlite3_other.go update code from github.com/mattn/go-sqlite3 2015-04-29 02:10:36 +02:00
sqlite3_test.go update code from github.com/mattn/go-sqlite3 2015-11-29 22:21:55 +00:00
sqlite3_windows.go build error on windows because of pthread 2016-07-01 21:43:08 +08:00
tomcrypt.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_argchk.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_cfg.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_cipher.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_custom.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_hash.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_mac.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_macros.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_math.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_misc.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_pk.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_pkcs.h add code 2015-04-29 01:56:53 +02:00
tomcrypt_prng.h add code 2015-04-29 01:56:53 +02:00
track_libtomcrypt.sh add script to track libtomcrypt changes 2015-09-13 16:57:01 +02:00
zeromem.c add code 2015-04-29 01:56:53 +02:00

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

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.