Evervault makes it easy to encrypt data at source, process it in a Cage — a secure, serverless function — and never store it unencrypted.
This is a simple Evervault Function example, to help get you up and running on the Evervault platform quickly.
Evervault consists of two parts, encrypting your data at source, using either our any of our SDKs and then sending that encrypted data to a Function to be processed securely.
This Function takes a payload that should contain a name
key. Running the Function is very simple.
- Encrypt your data at source, using one of our SDKs.
- Process the encrypted data in a Function
# This example uses the Evervault Python SDK.
import evervault
# Initialize the client with your app's API key
evervault.init("<YOUR_API_KEY>")
# Encrypt your data
encrypted = evervault.encrypt({ "name": "Claude" })
You should encrypt this payload using any SDKs, then run it in the Hello Function:
# Process the encrypted data in a Function
result = evervault.run("<YOUR_CAGE_NAME>", encrypted)
This Function is very simple. Here is the full code:
def handler(data):
if (data["name"] and isinstance(data["name"], str)):
print(f'A name of length {len(data["name"])} has arrived into the Function.');
return {
"message": f'Hello from a Function! It seems you have {len(data["name"])} letters in your name',
"name": f'{context["encrypt"](data["name"])}',
}
else:
print('An empty name has arrived into the Function.');
return {
"message": 'Hello from a Function! Send an encrypted `name` parameter to show Function decryption in action',
}
Or check it out in main.py.
If you want to know more about Evervault, check out our documentation.