Will it work well to use a .dmg as an encrypted folder?
Your use case is exactly why encrypted DMG were created. The external file name can be different than the actual name of the filesystem can be obfuscated while the drive is not mounted.

The only con (which kind of is a Pro) is that spotlight can't search within an unmounted image and you may want to disable spotlight entirely on that volume just in case you don't want any extra caches / extra access that isn't necessary.

Alternatives to this is storing text in a keychain secure note, especially if you keep alternate keychains for more secure information. I also find myself storing more things in 1Password when I don't need a self-contained archive for things like certain client data or certain data I wish to be doubly encrypted. (I use FileVault on most Mac these days so that everything is encrypted at least once.)