Data can be stored in encrypted form using Anvil’s App Secrets service.
The App Secrets service automatically generates encryption keys for you, and you can encrypt some plaintext using
ciphertext = anvil.secrets.encrypt_with_key(name_of_key, plaintext). You can then store the encrypted version however you like.
To decrypt, you run
plaintext = anvil.secrets.decrypt_with_key(name_of_key, ciphertext).
The App Secrets service also allows you to store secrets directly using the visual editor, then retrieve them using
anvil.sercrets.get_secret(name_of_secret). That’s useful for storing things you know at build time, such as API keys.
Add the App Secrets service to an app to explore further, or read about App Secrets in the reference docs.