Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to encrypt database ? #56

Open
barats opened this issue Sep 5, 2022 · 2 comments
Open

How to encrypt database ? #56

barats opened this issue Sep 5, 2022 · 2 comments

Comments

@barats
Copy link

barats commented Sep 5, 2022

Thanks for ur amazing work on https://github.com/glebarez/go-sqlite, which is VERY great project.

BTW, is there any possible way to encrypt database without relying on CGO?

@glebarez
Copy link
Owner

glebarez commented Sep 5, 2022

Let me forward all your credits to modernc.org/sqlite, since this repo is just a fork with minimal changes:

modernc.org/sqlite consists of:

  1. pure go implementation of SQLite (original C codebase is regularly transpiled into Go with great tools from modernc.org
  2. implementation for golang database/sql driver interface as described in https://pkg.go.dev/database/sql/driver

glebarez/go-sqlite:
is just a fork of modernc/sqlite with slight changes in the driver part (2), to behave more closely to mattn’s CGo version (https://github.com/mattn/go-sqlite3). this slight changes allowed it to be fully compatible with GORM (the GORM driver is in https://github.com/glebarez/sqlite)

Now, back to your question, I am assuming you mean translating some encryption-enabled fork of SQLite (e.g. https://github.com/sqlcipher/sqlcipher) into Go ?
This is only possible if developer of https://gitlab.com/cznic/sqlite will try to transpile it into Go.
There's already an issue for it: https://gitlab.com/cznic/sqlite/-/issues/105

@barats
Copy link
Author

barats commented Sep 6, 2022

Thanks for ur reply.

Let me come back to this issue later. I'm new to sqlite3, I might need to dig in a little bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants