Assuming you are using SQLite, an extension exists which will likely do the job: https://www.sqlite.org/see/doc/trunk/www/readme.wiki
Other databases will also have encrypt/decrypt APIs available.
Specific answers to your questions will depend on your application and use cases (local network? global website? credit card data? health data? etc...).