In addition to the documentation the @developernotes linked, a GUI tool called DB Browser for SQLite – which is compatible with SQLCipher databases – can be very handy for what you’re attempting to accomplish.
You might have a look at my response here: Save query results as csv which shows an example of how to export a table as a CSV using DB Browser for SQLite. The steps for what you’d like to accomplish should be very similar, but once you go to export the table generated by the query, you’ll want to use File → Export → Table(s) as JSON
I am not familar with SQLiteStudio, however it is unclear what problem you are facing. Please share the details of the issue here. Are you having a problem with SQLCipher specifically? If not, you might consider reaching out to the SQLiteStudio support here.
While there is no direct function to export from query to JSON within DB Browser for SQLite – you can have the query create a table, export the table to JSON, then drop the table so it doesn’t persist.
There’s an example in my previous response: Save query results as csv for CSV. All you should have to adjust is to use Export → Table(s) as JSON