Menu

cryptship | Part 1 — Binding the Decryption Key to the License and the Machine
📰

cryptship | Part 1 — Binding the Decryption Key to the License and the Machine

DEV Community: docker·Ai2th·about 2 hours ago
#jNmfkvsW
#devtodocker#devto#dev#license#machine
Reading 0:00
15s threshold

Most license checks look like this somewhere in the binary:

if ! license . Valid ( ) { os . Exit ( 1 ) }

Enter fullscreen mode

Exit fullscreen mode

Find that branch, flip one instruction, and the check is gone. cryptship moves the most important part of that check, which machine and which license , out of if statements and into the cryptography.

🔑 The key comes from the license

The content key that decrypts your app is never stored in the image. It is wrapped inside the license, and it can only be unwrapped with a key-encryption key (KEK) derived from the machine and the license's own claims:

KEK = HKDF ( machine_fingerprint , license_id , bound claims ) content_key = unwrap ( license . wrapped_key , KEK ) plaintext = aead_open ( payload .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.