LatePoint Data Encryption Plugin
Application-layer field encryption for LatePoint booking data, with a key held outside the web root.
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.
Encrypt the sensitive fields, not the whole database.
Constraints that shaped the design
No fork. LatePoint had to remain the booking engine.
Key separation. The key needed to live outside the web root.
Selective scope. Identifiers, dates, amounts and emails had to remain usable.
Transparent reads. Authorised screens had to receive plaintext.
Transparent encryption around LatePoint
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.
Three encryption paths
Booking save
- 01LatePoint saves the booking record.
- 02The plugin encrypts the selected fields.
- 03Ciphertext is stored in the existing row.
- 04An authorised user opens the booking.
- 05The role gate decrypts the fields for display.
Decryption failure
- 01A value fails to decrypt.
- 02The plugin returns the stored value and logs the failure.
- 03The admin screen stays usable.
- 04The operator checks the key and record state.
- 05A missing key blocks decryption rather than exposing data.
Record update
- 01A record is updated after the first save.
- 02The write hook runs again for the selected fields.
- 03The same key and a fresh nonce are used.
- 04Ciphertext replaces the previous value.
- 05Read paths remain transparent.
Evaluated options and trade-offs
Encryption primitive
A) Home-grown cipher
B) libsodium secretbox
libsodium secretbox
CRYPTOUse the platform cryptography library, a fresh nonce and a fixed key size.
The key must be protected and backed up.
Field scope
A) Whole row
B) Selected fields
Selected fields
DATA MODELLatePoint needs identifiers, dates and amounts to keep working, so only sensitive values are encrypted.
The field list must be maintained.
Integration
A) Fork LatePoint
B) Model hooks
Model hooks
ARCHITECTUREHooks keep the booking plugin upgradeable and the encryption layer separate.
The plugin depends on LatePoint lifecycle behavior.
Key and access controls
One level above web root
32 bytes after decode
Fresh 24-byte value per field
Decryption limited to allowlisted roles
Frontend and document routes receive plaintext
Missing key blocks decryption, reads return ciphertext
What the encryption layer guarantees
- 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.
- 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.
Transferable engineering principles
Selective encryption is a data model decision, not a database switch.
A key outside the web root is only useful if backup and rotation are planned.
Continue reading
Next Case Study → Brevo API Integration
Transactional email and event-driven notifications wired into a WordPress workflow.
Need a system architected like this?
Available for architecture advisory, custom PHP payment gateway bridges and resilient distributed workflows.