Currently, I use Joplin, which supports on device encryption and self-hosting. Previously, I relied on tools like git-crypt, TrueCrypt, or LUKS for encryption. However, as far as I know, git-crypt is not secure anymore. And using encrypted containers or file systems has the drawback of being difficult to share once they exceed a certain size.