Live Chat

We'll need to share your messages (and your email address if you're logged in) with our live chat provider, Drift. Here's their privacy policy.

If you don't want to do this, you can email us instead at contact@anvil.works.

Encryption and Secrets

Are you new here?

Anvil is a tool for building full-stack web apps with nothing but Python and a drag-and-drop designer. Learn more on our website, or sign up and try it yourself -- it's free!

Data can be stored in encrypted form using Anvil’s App Secrets service.

Encrypting and decrypting

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).

Storing Secrets at build time

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.