-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identity Key used for Encryption and Signature Creation #291
Comments
Can you expand on this a little? What is the client/server dialog? Are the keys part of |
You can see the code responsible for creating a DNS response message when a DNS request is sent to the Handshake Zone authoritative server for Lines 227 to 283 in 155051f
Notice that if you send a DNS query to the root for
The key pair is being used in both, which is the reason I am opening this issue. In the Handshake p2p protocol, the key is being used for encryption/authentication in brontide and in the DNS protocol it is used in a digital signature algorithm for SIG0.
The definition of a
Each integer along the top represents a single bit. The
The algorithm field is defined in RFC 2535, Section 3.2
Extra information below:
You can see that hsig.createKey = function createKey(pub) {
return sig0.createKey(sig0.algs.PRIVATEDNS, pub);
}; PRIVATEDNS: 253, // Private (experimental keys) https://github.com/chjj/bns/blob/6d517b4b4dbdab1fe289347e9b1ebd79e9b0dcb5/lib/hsig.js#L41 https://github.com/chjj/bns/blob/6d517b4b4dbdab1fe289347e9b1ebd79e9b0dcb5/lib/constants.js#L535 |
I thought the |
That is for DNSSEC, it creates a
Example from
Notice the This does raise the issue though of how to differentiate the SIG0 key and the brontide key if they are both made available via the DNS server. If they are both |
After talking to @boymanjor, we are thinking that there should be a clean split between the protocol layer and the DNS application layer. The brontide p2p identity key should NOT be made available via DNS. This would simplify my above proposal, as the @boymanjor also pointed out that in #126, it mentions:
Note that this is fairly offtopic from this issue and we can discuss the removal of I am in the process of researching what makes It also mentions:
|
Seems like the consensus here is a split between ID key and anything used for DNS. I was working on implementing some of the security considerations from the noise protocol paper into brontide today, and just came across this:
Source: https://noiseprotocol.org/noise.html#security-considerations Just wanted to bump this thread with that consideration. I also am for keeping the Identity key *only for brontide, and having separate signing keys for DNS. |
First, my 2c on the question at hand - yes, use separate keys (subject to dropping
I think this is the problem I have hit - unless the other side has the key, it can't verify the SIG0 record, so just rejects it. This is a guess, but seems about right. The
Personally, I think there is good case to say it is not necessary to implement a DNS layer at all. You could B) use PowerDNS in one of two ways Any of the above gives you a DNS mechaism that is capable of scaled performance & full RFC compliance. If you just have If However, your DNSSEC is currently not RFC compliant, so if you put it into bind, I suspect DNSSEC validation wouldn't work. Personally, I would think decentralised signing, as per the Yeti project, would be a more interesting way forward, as it removes the single point of failure of the root keys. Yeti: https://apan.net/meetings/apan46/files/22/22-04-03-01.pdf Yeti TL;DR - the point of the Yeti project was to show that if all ROOT operators used the same algorithm, then each ROOT operator could individually sign the ROOT zone with their own keys, with all 13 DS records included. So far (since 2015) it seems to work. So make it such that Any / all operators could also make the zone available for XFR, which could then be used as per the ISC doc above, for a more robust service. Any / all of these suggestions would make it far easier to create a resolver that uses the My 2c About me |
I would also recommend you change from a Presumably the blocks in the chain have a time-stamp you could use, which would be a nice confirmation of where in the chain the zone file is fresh to. Would also be nice to include some |
@james-stevens thanks for all the great insight, I'd love to chat with you on #handshake on freenode about some of these details sometime. I'll try to address a few of your points but I don't have the background you do. Re: CHAOS class: I had an idea about this as well: #443 This would mainly apply to hnsd the light client because it does not have any other interface besides DNS. hsd full nodes have a vast API for blockchain info already, and I'm not entirely sure that making chain status available to public queries is secure, private, DDoS resistant, etc. Re: SIG(0): This issue is a little outdated now since hsd full nodes no longer use Brontide (peer to peer encrypted communication) by default any more. There were issues with invalid public keys being gossiped around the network and the way it works now is that a user doesn't connect with Brontide unless they obtain the public key for that node out-of-band. SO for example, I would set up my own cluster of hsd full nodes to use for HNS resolution on my own computers, and plug the nodes' public keys into hdns to verify SIG(0). An example of that process is demonstrated in this article. This way, I can trust the answers from that node, and since I have confidence that this node is on the best valid proof-of-work chain, my system does not require a signed root zone. Interestingly, hsd full nodes also have a hard-coded private KSK/ZSK pair that is public! So of course the signatures are insecure but if you trust the resolver you can trick your legacy system into accepting the root keys for DNSSEC proofs. Re: Root Zone Dump: Another thing you bring up is the HNS resolver is missing some functionality, especially zone transfers. The HNS resolver is based on chjj/bns and I use it in several other projects. I recently discovered that zone transfer queries are not yet implemented and so I had to switch libraries in some cases. A pull request to bns would be super awesome to add this function in. There has also been discussion and a WIP branch to implement root-zone dumps from hsd. Re: SOA serial numbers: Another property of HNS you might not be aware is that the DNS records are all stored in a novel data structure called the Urkel Tree as described in the whitepaper, Urkel allows very fast compact proofs including exclusion proofs which make the light client
Could you expand on this a little more?
I've had some issues on Ubuntu where NetworkManger and its stub resolver running internally at Again thanks so much for your time and interest in Handshake, if you want to join us on IRC or Telegram https://t.me/hns_tech I'd be so happy to pick your brain about these details. |
Quite a few of the proofs I looked at are not RFC compliant - for example Look at the difference between
and I hope you will see what I mean. If your DNSSEC was compliant, it would be easy to get But, like I said, I think spending time writing yet another DNSSEC compliant DNS signer & server is an unnecessary use of resources when there is already a ton of stuff out there that does a pretty fine job. And yes, shipping out the private keys to everybody isn't great, although you could argue the contents of the ROOT zone is intended to be public knowledge anyway - but that's a whole different rabbit hole. But hard-coding them is a bad idea becuase - key rollover. I think decentralising signing and making the signed zones available for XFR, and letting people chose who they trust, would be a good solution in terms of the aims of the project.
A dump an unsigned zone to text file would be better than nothing - it would be easy to integrate that into Of course XFR would be nicer, but using
Ok - what you were doing wasn't immediately apparent as the last two digits of the SOA Serial appear to suggest more then 4 updates per day - e.g. The point more generally I was trying to make was I think you are unnecessarily trying to reinvent a wheel that not only doesn't need reinventing, but has already been reinvented more than enough times - i.e there is already far more choice of DNS server software than is really necessary - bind, unbound, nsd, PowerDNS & Knot are all pretty good. Obviously I've actually written a DNSSEC compliant authoritative DNS server before - its still live on So, if it was me, I would dump the unsigned zone to a text file and be done. The rest can be handled perfectly well by existing s/w If what you have can't integrate with existing DNS s/w then you must realise this limits its use and I suspect that scaling this to realistically high query volumes just isn't possible. The other point was to decouple the DNS from the blockchain, by either dumping a zone or XFR - there's no need to have them so integrated. |
Overview
Edited 11/1/19
Right now the identity key (secp256k1 keypair) is used in multiple locations for different purposes.
The
Pool
uses it forbrontide
. It is used for encryption and authentication in this context. See bolt #8 for more details. The codepath:hsd/lib/node/fullnode.js
Lines 84 to 93 in 155051f
hsd/lib/net/pool.js
Line 1112 in 155051f
hsd/lib/net/peer.js
Line 64 in 155051f
hsd/lib/net/peer.js
Line 310 in 155051f
Both the
RootServer
and theRecursiveServer
use the key for authentication, signing messages for SIG0. The codepath:hsd/lib/node/fullnode.js
Lines 145 to 147 in 155051f
hsd/lib/dns/server.js
Line 584 in 155051f
I have read that it is not the best idea to use the same key for both encryption and in digital signature algorithms as it exposes interactions between the algorithms. The attacker can choose the text that is signed and collect many signatures, since every DNS request that they send will be signed with the key. It is possible that a side channel attack is possible here, such as the recently discovered Minerva. If such a side channel existed, it would be bad if the attacker was able to decrypt the p2p messages between two nodes. I believe an attacker may be able to do this if they were able to collect all traffic between the two nodes and pull the side channel attack on both of the nodes.
Proposal
SIG0
and for brontide.Both theSIG0
key and the brontide key returned for a DNS request to the Handshake root.
for the resource record typeKEY
(SIG0
specifies that in its RFC).SIG0
key is returned for a DNS request to the Handshake root for RR typeKEY
SIG0
for something better long term (leaning towards DNS over HTTPS personally)cc: @chjj @boymanjor @kilpatty @pinheadmz
The text was updated successfully, but these errors were encountered: