Request: Encrypted at Rest (Adiantum, VFS) Example #283
-
Hi there, I'm newer to go (mostly work on Java at my job) so this is probably a me issue, but I cannot for the life of me seem to wrap my head around how to implement the encrypted at rest vfs. I'm working on a Wails project (Journaling app) for fun and feel like I should have an encrypted db for it. I'd gotten it working a bit but it seems to store the encryption key with the database file (ex. database.db?vfs=adiantum&key=baa17dfb854a4b063bdb0588330e97b0441d255eeed429a62c442666fcd14ddd), which I'd think defeats the point of encrypting it. So I must be missing something. Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Did you mean to close this? The key is not stored in the database, that's why you need to supply it with the database name in the Either as a Importing package Key management is up to you. |
Beta Was this translation helpful? Give feedback.
Did you mean to close this?
The key is not stored in the database, that's why you need to supply it with the database name in the
file:
URI.Either as a
hexkey
ortextkey
(“password”):file:database.db?vfs=adiantum&textkey=correct+horse+battery+staple
Importing package
github.com/ncruces/go-sqlite3/vfs/adiantum
and using the URI like the above is all you need to do.Key management is up to you.