And I’m not talking about our https website or online store with SSL. No, this is an API that stack developers can use to secure the updates to their stacks AND a separate API that lets developers hide their proprietary private information.
Stack Code Privacy
A number of Stack developers came to me a few years ago worried that their hard work was being copied by other unscrupulous developers.
To discourage copying Stacks uses simple public key encryption. The Stacks public key is included in the API. Developers encrypt their stacks using this key. Since only Stacks has access to the private key, only Stacks can decrypt them.
A very negative way to look at this is that it keeps nosey folks from peeking where they probably shouldn’t.
More realistically, the suspicions and anxieties between developers can make it hard to be friends with other developers. It was really hurting our developer community.
Adding a layer of encryption lets developers stop worrying about each other so much.
Stacks Update Security
Stack developers and users need to be sure that updates are handled securely – this comes in three parts
Private Key Signature
Stacks digitally signs all update requests using the Stacks private key. Developers can verify the request on their update server using the Stacks public key.
- developers can be sure requests come only from Stacks.
- developers can be sure the request hasn’t been modified in any way.
Public Key Signature
Stacks also signs update requests with the public key in the stack. Developers can use their own private key to verify the signature.
- when combined with stack encryption, developers can be sure requests come only from those who already have one of their stacks.
If Stacks sent a public key signature (#2) , then it will only accept a response that is also signed. The signed response is verified with the same public key from (#2).
- Stacks can be certain that a stack with a public key signature is only updated with the developer that created the stack.
Why Not Use SSL?
You might wonder why Stacks doesn’t simply use SSL like the web?
Well, of course, we do use SSL too, if the developer’s update server has SSL.
But SSL is not a panacea. SSL ensures that no one else can see the info as passes through the internet. And it also ensures that if Stacks contacts https://elixirgraphics.com that they’re not talking to someone else masquerading as Elixir Graphics, or some hacker using the same WiFi at Starbucks. SSL is good for those things.
And that’s all a good start – but it doesn’t solve many of the other challenges of keeping a stack update safe. Adding our security and privacy layers on top of SSL gives us:
- devs know their proprietary info is hidden
- devs know that the update request came directly from Stacks
- devs know that the update request came from one of their own stacks
- Stacks knows that the update response came from the right developer
Want to learn more
If you’re a developer and you would like to learn how to keep your stack private or secure your updates, you can read more about it on the secure stack api pages on GitHub. There is a walkthrough of the entire API, simple command line scripts for generating public/private keys, example Php to use on your update server to sign and verify updates, and quite a bit more.
If you have questions, feel free to stop by the Slack group and chat.