status-go/vendor/github.com/mutecomm/go-sqlcipher
Lukáš Tinkl f3c826275e
[go-sqlcipher] replace AES implementation with mbedtls (#3518)
HW accelerated versions provided for x86_64 and arm64, with compile time
guards and runtime detection

needed for status-im/status-desktop#10726

---------

Co-authored-by: Alex Jbanca <alexjb@status.im>
2023-05-25 11:30:11 +02:00
..
.travis.yml Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
LICENSE Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
MAINTENANCE Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
Makefile Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
README.md Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
aes.c [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
aesce.c [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
aesce.h [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
aesni.c [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
aesni.h [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
burn_stack.c performance(sqlcipher): Fix burn_stack performance issue 2023-05-12 09:08:39 +03:00
cbc_decrypt.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
cbc_done.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
cbc_encrypt.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
cbc_start.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_argchk.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_cipher_descriptor.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_cipher_is_valid.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_find_cipher.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_find_hash.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_hash_descriptor.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_hash_is_valid.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_prng_descriptor.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_register_cipher.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_register_hash.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
crypt_register_prng.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
error.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
flags.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
fortuna.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
hash_memory.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
hmac_done.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
hmac_init.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
hmac_memory.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
hmac_process.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
mbtls_aes.c [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
mbtls_aes.h [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
pkcs_5_2.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
sha1.c performance(sqlcipher): provide optimized versions of sha1_compress (#3490) 2023-05-16 20:18:38 +02:00
sha256.c Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
sqlcipher.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
sqlite3.c Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
sqlite3.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
sqlite3.h Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
sqlite3_other.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
sqlite3_windows.go Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt.h [go-sqlcipher] replace AES implementation with mbedtls (#3518) 2023-05-25 11:30:11 +02:00
tomcrypt_argchk.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_cfg.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_cipher.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_custom.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_hash.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_mac.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_macros.h performance(sqlcipher): provide optimized versions of sha1_compress (#3490) 2023-05-16 20:18:38 +02:00
tomcrypt_math.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_misc.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_pk.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_pkcs.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
tomcrypt_prng.h Add x3dh key exchange (#1127) 2018-09-24 20:07:34 +02:00
track_libtomcrypt.sh migrate to go 1.12 and go modules 2019-06-12 13:12:00 +02:00
zeromem.c performance(sqlcipher): Fix burn_stack performance issue 2023-05-12 09:08:39 +03: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.

go-sqlcipher currently only supports the SQLCipher 3.x releases.

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.