Closed jackywu closed 1 month ago
Definitely!
You could try to write your own storage (see docs).
It's fairly simple; you only need four methods.
__init__
, read
, write
, and close
.
Since you want to use authentication, I assume adding a password to the __init__
function would be the easiest.
To actually encrypt the data, you can use something like cryptography.
You can use these docs to create a password.
__init__
function).Decrypting and encrypting on every read and write, respectively, will have a certain performance penalty, of course. You could also decrypt the file once on initialization and encrypt it during the close, but this will result in the file being readable on disk for as long as the program is active.
As @MrPigss, it's possible to create a new storage that stores files on disk with encryption. Including such a storage within TinyDB core is out of scope for this project, though 🙂
is it possible to encrypt DB file and add authentication for connection ?