A support application needs to search tickets, route requests and show staff where work is pending. A ticket may also contain a customer’s private phone number or an identity document. The routing service can assign the ticket using its ID and status. The employee reviewing the case may be the only person who needs to see the document.
That distinction matters while the application is running. Database encryption protects files on disk, while an authorised database query can still read their contents. For a small or mid-sized team, the first design decision is which people and components need each sensitive field in plaintext to do their work.
ScaleTag is an open-source information-sharing project. People can publish and browse public Tasks, and respondents can share private contact details with the corresponding Task publisher. ScaleTag follows the application encryption principles described here. Its Task workflow keeps public information accessible, encrypts sensitive fields before they reach the backend and limits decryption to the intended recipient. ScaleTag project and architecture
1. Identify Sensitive Data in Your Industry
The meaning of a field depends on its context. A phone number published for customer enquiries is public. A phone number linked to a medical appointment may reveal that someone sought care. A production tolerance can contain no personal information and still be sensitive because altering it can affect product safety.
Start with a business workflow. Record what each field contains, why it is collected, who receives it, where copies go and how long the business keeps it. Check the legal, industry and contractual obligations that apply to that workflow. Then assess the consequences of disclosure, alteration or loss. Consider what someone could learn by combining the field with other data.
| Industry | Example | What drives the classification |
|---|---|---|
| Healthcare | Patient details linked to an appointment | Disclosure can reveal that someone sought care. An incorrect record can affect treatment. |
| Retail | Payment card details at checkout | Disclosure can enable fraud. A payment provider’s token may let the merchant complete the workflow without handling raw card details. |
| Payroll | Salary and employee bank details | Disclosure exposes private financial information. Changing a destination account can divert payments. |
| Manufacturing | Unreleased designs and production tolerances | Disclosure can expose intellectual property. Alteration can affect product quality or safety. |

Have the data owner record the classification, the reason for it and who needs to see the actual value. Revisit the decision when the data is combined with another dataset, shared with a new recipient or used for a different purpose. A notification service may need to know that a customer requested a callback. The person making the call needs the number.
2. Design Encryption Around Where Plaintext Is Needed
Encryption transforms readable data into ciphertext that can be recovered with the appropriate key. Authenticated encryption, such as AES-GCM, also lets the recipient detect tampering. In practice, the protection depends on which components can use the key and where the data becomes readable.
| Control | What it protects | Where plaintext is available |
|---|---|---|
| TLS | Data travelling between endpoints | At the endpoints, including the service that terminates TLS |
| Database or volume encryption | Stored files and covered snapshots | To authorised queries after the database or storage is unlocked |
| Server-side field encryption | Selected fields in storage and internal data flows | To authorised workloads that can decrypt the fields |
| Client-side field encryption | Selected fields before submission and throughout backend processing | On the sender’s device and on the intended recipient’s device |
If a backend worker needs plaintext to complete a transaction, scope decryption to that worker and operation. In envelope encryption, a data key encrypts the field, and a key management service protects the data key. The application still needs to enforce which workloads can request decryption. If the backend only routes a value to its recipient, the sender can encrypt it before submission and the recipient can decrypt it on their device.
Test the boundary with a synthetic record through the real application. Inspect requests, logs, queues and exports where applicable. Verify that authorised users can complete the workflow and that other users and services receive only what they need. Test recovery, too. If the recipient alone holds the decryption secret, restoring the encrypted record and recovering its plaintext are separate operations.
3. ScaleTag Applies Field-Level Encryption to Task Replies
ScaleTag puts this design into practice in one specific workflow. Visitors can browse public Tasks. A respondent can leave a phone number or email address in dedicated private contact fields, and only the corresponding Task publisher needs those details to follow up. The backend associates the reply with the Task, stores it and returns it to the publisher while handling the contact fields as ciphertext.

- Publish the Task. The publisher’s browser generates a Task key pair and a random management secret. It derives separate material for server-side authentication and private-key encryption. The server receives the public key, the encrypted private key and the derived authentication credential. The publisher keeps the management secret.
- Submit a reply. The respondent’s browser obtains the Task public key and generates a temporary key pair. It uses P-256 ECDH to establish a shared secret and HKDF to derive an AES-256-GCM key. The browser encrypts the phone number or email before submission.
- Store and return the reply. ScaleTag stores the ciphertext and the public parameters needed for decryption. When the publisher requests the reply, the server checks the management credential and returns the encrypted records.
- Open the contact details. The publisher’s browser uses the management secret to unlock the Task private key, reconstructs the reply key and displays the contact details locally.

ScaleTag uses SQLite for public Task records and encrypted contact fields. SQLCipher protects the database files, and AES-256-GCM protects backup exports. When the application opens the database or an operator restores a backup, the private contact fields still require the Task decryption workflow. If the publisher loses the management secret, ScaleTag cannot recover those contacts on their behalf. ScaleTag source code
4. Prepare for Q-Day According to the Life of the Data
Q-Day is shorthand for the point at which a sufficiently capable quantum computer can break widely used public-key cryptography. Its timing is uncertain. The business question is how long sensitive data must stay confidential. Someone who obtains ciphertext and its associated public parameters can retain them for future decryption. Records that must stay private for years deserve earlier attention. NIST guidance on transitioning to post-quantum cryptography
In ScaleTag, P-256 ECDH supplies the shared secret used to derive the contact encryption key. A sufficiently capable quantum computer could recover a Task’s elliptic-curve private key from its public key. With the temporary public keys stored alongside the replies, an attacker could reconstruct the keys for historical contact records even if the publisher’s management secret remained private.
A proposed upgrade is to use ML-KEM-768 for key establishment and continue using AES-256-GCM for the contact fields. The respondent’s browser would use the Task’s ML-KEM public key to create a shared secret and an encapsulation ciphertext. The publisher’s browser would recover that secret with the Task private key. The current ScaleTag implementation uses P-256. NIST FIPS 203
For a small team, start with the records that have the longest confidentiality requirements and inventory the public-key mechanisms that protect them. Version each encrypted record so the application knows which algorithm it uses. In ScaleTag, existing contacts that still need protection would have to be decrypted and re-encrypted in the publisher’s browser. Retained backups containing old records need an expiry or replacement plan. Copies already taken outside the service retain their original cryptographic protection.
Keeping track of who needs plaintext and how their keys are established gives a small team a practical basis for both everyday data protection and a targeted post-quantum migration.