Russell Parker

How Learning GPG Is Like Learning Git

Experience of Learning GPG

I’ve been trying to teach myself more about cryptography and GPG in particular. The resources I’ve encountered so far mainly fall into two categories:

Some include a primer on public-key cryptogaphy but they otherwise lack details that would help build a mental model of GPG. One notable exception was Anatomy of a GPG Key which also echoes similar observations about the style of other guides.

GPG is often criticized for its poor usability and perhaps it’s this poor usability that drives people to make instructional resources rather than conceptual ones. I think a better approach to teaching the tool is emphasizing the underlying structure of keys and how various steps affect this structure. Running a series of commands to perform key maintenance would be more intuitive with an understanding of what’s going on at the key packet-level.

This perspective on studying GPG has parallels in how some people learn Git.

Learning Git

There are tons of Git tutorials covering things like cloning repos, staging changes, and pushing commits. There is nothing wrong with starting here but just memorizing these routines can eventually obscure the simplicity of the underlying system.

Mastering Git means touching on blobs and Merkle trees and SHA-1 hashes. Knowing these details provides a more manageable mental map which is important because a big part of learning is creating a mental scaffolding and incorporating auxiliary info and data points.

Chapter 10 of Pro Git opens with the tradeoff between introducing porcelain commands and covering the core design of Git.

…this is where we’ll go over the inner workings and implementation of Git. We found that understanding this information was fundamentally important to appreciating how useful and powerful Git is, but others have argued to us that it can be confusing and unnecessarily complex for beginners.

While it may be “confusing and unnecessarily complex” to begin here, I’d argue that covering these inner workings eventually leads to a more intuitive grasp of how to accomplish tasks with Git rather than just regurgitating a series of commands.


In The Mythical Man-Month: Essays on Software Engineering, Fred Brooks wrote,

Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious.

This line of thinking applies to learning tools as well. Ultimately, a crucial part of understanding systems like Git and GPG is understanding their data strctures. We’re always going to need reference material but focusing too much on just procedural steps will prevent a simpler comprehension.