LatePoint Data Encryption Plugin

Application-layer field encryption for LatePoint booking data, with a key held outside the web root.

ROLEPlugin developerEncryption design and implementation
SCOPELatePoint models, key handling and role-gated decryptionSingle plugin
STACK PATTERNSWordPress / PHP / libsodium / LatePointNo fork
STATUS
Production plugin
Client work, anonymized
01 · CONTEXT AND TRUST BOUNDARIES

Protecting sensitive booking fields without a fork

A booking system stored sensitive customer and appointment data in the same database as the rest of the WordPress site. The team needed protection at the application layer without replacing LatePoint or changing the staff workflow.

Encrypting whole rows would break booking, reporting and search. The design had to encrypt a narrow set of sensitive fields while leaving identifiers, dates, amounts and scheduling data usable.

The key also needed to live outside the web root, with a clear role boundary for decryption.

CORE CONSTRAINT

Encrypt the sensitive fields, not the whole database.

02 · SYSTEM REQUIREMENTS

Constraints that shaped the design

C-01 · KEY

No fork. LatePoint had to remain the booking engine.

C-02 · SCOPE

Key separation. The key needed to live outside the web root.

C-03 · ROLES

Selective scope. Identifiers, dates, amounts and emails had to remain usable.

C-04 · FAILURE

Transparent reads. Authorised screens had to receive plaintext.

03 · TOPOLOGY AND NODES

Transparent encryption around LatePoint

BOOKING SAVE · ENCRYPTED FIELDS
KEY OUTSIDE WEB ROOT
WRITE AND READ PATH

Booking → Hook → Key → Cipher → Role gate → View. LatePoint saves the record, the plugin encrypts the selected fields, and authorised model reads decrypt them in memory. Identifiers, dates and amounts remain usable.

04 · LIFECYCLE FLOWS

Three encryption paths

Booking save

SUCCESS
  1. 01LatePoint saves the booking record.
  2. 02The plugin encrypts the selected fields.
  3. 03Ciphertext is stored in the existing row.
  4. 04An authorised user opens the booking.
  5. 05The role gate decrypts the fields for display.

Decryption failure

RECOVERY
  1. 01A value fails to decrypt.
  2. 02The plugin returns the stored value and logs the failure.
  3. 03The admin screen stays usable.
  4. 04The operator checks the key and record state.
  5. 05A missing key blocks decryption rather than exposing data.

Record update

IDEMPOTENT
  1. 01A record is updated after the first save.
  2. 02The write hook runs again for the selected fields.
  3. 03The same key and a fresh nonce are used.
  4. 04Ciphertext replaces the previous value.
  5. 05Read paths remain transparent.
05 · ARCHITECTURAL DECISION RECORDS

Evaluated options and trade-offs

ADR-001 · D1

Encryption primitive

ACCEPTED & DEPLOYED
OPTIONS EVALUATED

A) Home-grown cipher

B) libsodium secretbox

CHOSEN DECISION

libsodium secretbox

CRYPTO
RATIONALE

Use the platform cryptography library, a fresh nonce and a fixed key size.

ENGINEERING TRADE-OFF

The key must be protected and backed up.

ADR-002 · D2

Field scope

ACCEPTED & DEPLOYED
OPTIONS EVALUATED

A) Whole row

B) Selected fields

CHOSEN DECISION

Selected fields

DATA MODEL
RATIONALE

LatePoint needs identifiers, dates and amounts to keep working, so only sensitive values are encrypted.

ENGINEERING TRADE-OFF

The field list must be maintained.

ADR-003 · D3

Integration

ACCEPTED & DEPLOYED
OPTIONS EVALUATED

A) Fork LatePoint

B) Model hooks

CHOSEN DECISION

Model hooks

ARCHITECTURE
RATIONALE

Hooks keep the booking plugin upgradeable and the encryption layer separate.

ENGINEERING TRADE-OFF

The plugin depends on LatePoint lifecycle behavior.

06 · SECURITY CONTROLS

Key and access controls

1. Key location

One level above web root

2. Key size

32 bytes after decode

3. Nonce

Fresh 24-byte value per field

4. Role gate

Decryption limited to allowlisted roles

5. Frontend reads

Frontend and document routes receive plaintext

6. Failure mode

Missing key blocks decryption, reads return ciphertext

07 · OUTCOMES

What the encryption layer guarantees

WHAT HOLDS TRUE
  • Sensitive booking fields are encrypted at rest.
  • LatePoint screens still render plaintext for authorised roles.
  • The key is separated from the database and web root.
  • The booking engine remains a dependency, not a fork.
  • Encrypted values are unrecoverable without the key. No backfill or recovery.
What I would improve (Engineering Self-Critique)
  • Add key rotation and a key version header.
  • Add an audit log for decryption events.
  • Move encryption before the first insert where the model allows it.
08 · RETROSPECTIVE

Transferable engineering principles

PRINCIPLE 01

Selective encryption is a data model decision, not a database switch.

PRINCIPLE 02

A key outside the web root is only useful if backup and rotation are planned.

Continue reading

UP NEXT IN ARCHITECTURE DOSSIERS

Next Case Study → Brevo API Integration

Transactional email and event-driven notifications wired into a WordPress workflow.

Architecture & Payment Infrastructure
Open to New Work

Need a system architected like this?

Available for architecture advisory, custom PHP payment gateway bridges and resilient distributed workflows.

PORT: 443/TLS·LOCATION: Rajkot, India / Remote·STATUS: Available for Eng Interviews
UTC+5:30 · P99 RESPONSE: < 24H