Designing a license key humans can type: base32, segment grouping, and a check digit that catches typos
DEV Community
Designing a license key humans can type: base32, segment grouping, and a check digit that catches typos
A Keyright license is signed bytes, but the thing a customer reads off an invoice, types into an activation dialog, or dictates over the phone is a string — and base64 is a terrible string for that job. It is case-sensitive, it uses + and / which get mangled in email and shells, and a single mistyped character produces a signature failure with no hint of where the mistake was. This post builds the transport encoding Keyright actually uses: Crockford base32 so the alphabet survives a phone call and a shift key, five-character segments so the eye can track position, and a mod-37 check symbol that catches every single-character error and almost every transposition before you ever run the expensive signature verification. It shows the real encode and decode in C#, the normalization that turns a sloppily typed key back into canonical bytes, and why the check digit is an ergonomics feature and never a security one.
0 comments
No comments yet.