Send an SMS to an encrypted phone number.
Evervault is encryption infrastructure for developers. We build simple tools so that your apps only handle and process data that is encrypted at the field-level at all times.
In this tutorial, we’re going to use Evervault to encrypt phone numbers, verify that they’re valid, and to send an SMS with Twilio. This tutorial is designed for beginners, and aims to demonstrate how to effectively integrate Evervault.
We’ll be using Express.js, a library for easily building APIs in Node.js, and the tools we’ll use include:
- Replit, a collaborative browser-based IDE for writing code and building apps in your browser
- Evervault Relay, a simple way to automatically encrypt data at the field-level before it touches your app, and decrypt it as it leaves
- Evervault Cages, isolated serverless functions hosted on Evervault for processing the data encrypted with Relay
- Twilio SMS API, an API for sending SMS messages
First, we’ll set up our Express API in Replit. This API will include creating a HTML form for collecting a name and a phone number from a user. Next, we’ll create a Relay to automatically encrypt phone numbers before they touch our API. We’ll then create and deploy a Cage to verify that a phone number is valid. Finally, we’ll take the name and encrypted phone number and send the user an SMS using Twilio.
All the code for this application can be found on the Evervault Replit. If you want to follow along from scratch, continue reading.