Skip to content

Case study

CSV Data Encrypter

A tool that encrypts the contents of a CSV against a separate key file, so the data cannot be read or recovered without the key that produced it.

Overview

Encrypts the contents of a CSV against a separate key file, so the data can be moved or stored without being readable, and decrypted only by whoever holds the key. Public.

Written the day before the anonymisation tool for the same problem space, and the two are complementary: one makes data unreadable to anyone without a key, the other makes it useless to everyone including the key holder.

Complexities tackled

Encryption without key management is theatre. The interesting decision is that the key lives in its own file rather than being derived from a password typed at the prompt. That makes the tool scriptable and the key rotatable, at the cost of the key now being a thing that has to be looked after, which is the honest trade.

Preserving structure while encrypting content. A file where the shape is destroyed along with the values cannot be checked, moved or partially processed. Keeping the CSV a CSV means it can still be handled by tools that have no idea what is inside it.

Stack

Python with the cryptography library and Fernet symmetric encryption.

Working on something similar?

Tell me what you are building and what is in the way. I will tell you honestly whether I am the right person for it.

Start a conversation

Last updated: