status-go/vendor/github.com/mutecomm/go-sqlcipher/v4
frank 163b583b0d chore: make lint-fix 2024-03-07 20:31:28 +08:00
..
_example chore: make lint-fix 2024-03-07 20:31:28 +08:00
LICENSE chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
MAINTENANCE chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
Makefile chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
README.md chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
aes.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
aesce.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
aesce.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
aesni.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
aesni.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
backup.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
burn_stack.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
callback.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
cbc_decrypt.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
cbc_done.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
cbc_encrypt.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
cbc_start.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
compare_testvector.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
convert.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_argchk.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_cipher_descriptor.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_cipher_is_valid.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_find_cipher.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_find_hash.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_hash_descriptor.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_hash_is_valid.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_prng_descriptor.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_register_cipher.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_register_hash.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
crypt_register_prng.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
doc.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
error.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
flags.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
fortuna.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
hash_memory.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
hmac_done.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
hmac_init.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
hmac_memory.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
hmac_process.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
mbtls_aes.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
mbtls_aes.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
pkcs_5_2.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sha1.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sha256.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sha512.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlcipher.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_context.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_func_crypt.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_go18.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_libsqlite3.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_load_extension.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_load_extension_omit.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_allow_uri_authority.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_app_armor.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_foreign_keys.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_fts5.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_icu.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_introspect.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_json1.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_preupdate.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_preupdate_hook.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_preupdate_omit.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_secure_delete.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_secure_delete_fast.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_stat4.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_unlock_notify.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_unlock_notify.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_userauth.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_userauth_omit.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_vacuum_full.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_vacuum_incr.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_opt_vtable.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_other.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_solaris.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_trace.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_type.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_usleep_windows.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
sqlite3_windows.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
static_mock.go chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_argchk.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_cfg.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_cipher.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_custom.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_hash.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_mac.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_macros.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_math.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_misc.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_pk.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_pkcs.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_private.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
tomcrypt_prng.h chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
track_go-sqlite3.sh chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
track_libtomcrypt.sh chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00
zeromem.c chore(upgradeSQLCipher): Upgrading SQLCipher to version 5.4.5 (#3559) 2023-06-07 08:58:01 +03:00

README.md

go-sqlcipher

GoDoc CI

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.

Incompatibilities of SQLCipher

The version tags of go-sqlcipher are the same as for SQLCipher.

SQLCipher 4.x is incompatible with SQLCipher 3.x!

go-sqlcipher does not implement any migration strategies at the moment. So if you upgrade a major version of go-sqlcipher, you yourself are responsible to upgrade existing database files.

See migrating databases for details.

To upgrade your Go code to the 4.x series, change the import path to

"github.com/mutecomm/go-sqlcipher/v4"

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 size).

key := url.QueryEscape("secret")
dbname := fmt.Sprintf("db?_pragma_key=%s&_pragma_cipher_page_size=4096", key)
db, _ := sql.Open("sqlite3", dbname)

This uses a passphrase directly as _pragma_key with the key derivation function in SQLCipher. Do not forget the url.QueryEscape() call in your code!

See also PRAGMA key.

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.