%lBglUeQhHbKRGigcXXZmeQOTXisoSAI9J3X6vnxsDhA=.sha256
{ "previous": "%i6KvFJo+CbTgahxMijL97nuIecJp/fq/kpVBaLLfxGc=.sha256", "author": "@EMovhfIrFk4NihAKnRNhrfRaqIhBv1Wj8pTxJNgvCCY=.ed25519", "sequence": 1555, "timestamp": 1458953620035, "hash": "sha256", "content": { "type": "post", "text": "oh, sorry, let me clarify one thing I said wrong.\n\nThere are two types of asymmetric cryptography (not actually the whole story but will do for now) signing, and exchange.\n\nyou create a signature with a signing (private) key, and it's verified with a corresponding public key.\n\nThen there are also exchange keys, or called diffie-helman keys. There isn't really a widely used name for this type of key, mainly i think because it doesn't have a simple real-world metaphor like \"signing\" does. Anyway, exchange keys take _your_ public key, and _my_ secret key then combines the together to produces a shared exchange key.\n\nIn `nacl` this operation is called `scalarmult`. That is an implementation detail really, in classic DiffieHelman a different mathematical operation is used, but it has the same behavior. That is, we can each take the other's public key, and our own secret key, and produce a key that essentially represents a relationship between us.\n\nIn nacl both types of keys are used, signing keys are ed25519 keys, and exchange keys are curve25519 keys. `sign` uses `ed25519` keys, and `scalarmult` takes `curve25519`.\n`box` takes two exchange keys, and then uses `scalarmult` internally. There is also another function `secretbox` that just takes a symmetric key, say the output of `scalarmult`.\n\nTo encrypt a private key, you probably don't encrypt it _to_ anyone, so `secretbox` is the one to use. Also, you'll need to generate the key the first time, and then later, you'll need to restore it. To do that, you need a _seed_. That is just a random number, but make sure it's _really_ random. instead of encrypting the private key, encrypt the seed, then regenerate the keypair from that seed.\n", "root": "%BOMhRjBpWGwzLDVM3PQMfX06VhS2Kw3e7d70qD6w/P4=.sha256", "branch": "%6gQ230f7lw3pr27P2afwi9q7q8+YJ4nUDfuZ5oKCaAo=.sha256", "channel": "javascript" }, "signature": "AkFnXMXxEgOatU772WM2y7t+Fpd/imPj0Rv6Yj9FpsAPsTRqnEeZhxpyt8PoihSBqY9CfQYcg0XNzsFPiKPjBw==.sig.ed25519" }
Built with git-ssb-web