{"type":"rich","version":"1.0","author_name":"npub1jqxs4ftunmm8qjyw9s80hpcayewkjfhpxund29l9qvzy7xqx4duq85jqeg","author_url":"https://nostr.ae/npub1jqxs4ftunmm8qjyw9s80hpcayewkjfhpxund29l9qvzy7xqx4duq85jqeg","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2021-02-12\n📝 Original message:On Fri, Feb 12, 2021 at 9:36 AM Dmitry Petukhov \u003cdp at simplexum.com\u003e wrote:\n\n\u003e If HUMAN_READABLE_TITLE is the additional secret, the user would need\n\u003e to enter it on the device in addition to the nonce, wouldn't it defeat\n\u003e the advantage in UX that was gained by using (relatively) short nonce ?\n\u003e\n\u003e Is 64 bit nonce not enough ?\n\u003e\n\u003e\nGood question. If we don't need the extra entropy, we can fix\nthe HUMAN_READABLE_TITLE string.\n\nSomething like \"No SPOF\". (No Single Point Of Failure).\n\n\n\n\u003e It seems that to crack this with fixed Pwd and 64 bit nonce, the\n\u003e attacker will need to be about 10^15 more powerful than 80Mhz MCU:\n\u003e (2^64)/(0.3*10^15)/3600 = 17 hours. I don't know if 10^15 is realistic\n\u003e scale. Average desktop cpu seems to be about 10^3 more powerful than\n\u003e the mentioned MCU for this task.\n\u003e\n\u003e Maybe for the UX it would be better to choose the number of rounds to\n\u003e use in PBKDF2, instead of using variable Pwd. Number of rounds will be\n\u003e easier to enter on the device (or just choose it from a set of\n\u003e pre-defined values). The more money is at stake, the higher number of\n\u003e rounds could the coordinator choose (taking into account the\n\u003e characteristics of the participant devices)\n\u003e\n\n\u003e Or simply allow bigger entropy (more than 6 mnemonic words), if\n\u003e the coordinator feels that 64 bit of entropy is not enough.\n\n\nThat could work. Allowing variable iteration count is probably better\nUX-wise.\n\nBest,\nHugo\n\n\n\u003e\n\u003e В Fri, 12 Feb 2021 08:55:55 -0800\n\u003e Hugo Nguyen \u003chugo at nunchuk.io\u003e wrote:\n\u003e\n\u003e \u003e Thanks everyone who has provided inputs so far!\n\u003e \u003e\n\u003e \u003e This is the new proposal for the encryption aspect of the scheme,\n\u003e \u003e based on all the feedback.\n\u003e \u003e\n\u003e \u003e The key derivation function would be PBKDF2, with PRF = SHA512. This\n\u003e \u003e should be readily available on today's hardware already, as they are\n\u003e \u003e used for BIP39.\n\u003e \u003e\n\u003e \u003e DK = PBKDF2(PRF, Password, Salt, c, dkLen)\n\u003e \u003e PRF = SHA512\n\u003e \u003e Pwd = HUMAN_READABLE_TITLE\n\u003e \u003e Salt = NONCE\n\u003e \u003e c = 2048\n\u003e \u003e dkLen = 256\n\u003e \u003e\n\u003e \u003e HUMAN_READABLE_TITLE is in ASCII format, minimum length = 8, maximum\n\u003e \u003e length = 20.\n\u003e \u003e NONCE is a 64-bit number.\n\u003e \u003e\n\u003e \u003e Reason for going with SHA512 is due to legacy support on some\n\u003e \u003e hardware. c=2048 also mimics BIP39. It takes about ~3 seconds to\n\u003e \u003e derive the encryption key on a 80Mhz MCU. We feel like this is a good\n\u003e \u003e enough tradeoff for this use case. The assumption here is that the\n\u003e \u003e secure session is only needed temporarily for a few hours, maybe up\n\u003e \u003e to one day.\n\u003e \u003e\n\u003e \u003e The Coordinator and Signers agree and exchange these 2 secrets prior\n\u003e \u003e to the setup. The NONCE can be converted to either:\n\u003e \u003e (a) a 6-word phrase using BIP39 wordlist\n\u003e \u003e (b) a 20-digit decimal number\n\u003e \u003e (c) a QR code\n\u003e \u003e\n\u003e \u003e Depending on the vendor. This flexibility in the data format allows\n\u003e \u003e each vendor to customize the UX based on their respective device\n\u003e \u003e capabilities.\n\u003e \u003e\n\u003e \u003e Best,\n\u003e \u003e Hugo\n\u003e \u003e\n\u003e \u003e On Thu, Feb 11, 2021 at 8:25 AM Dmitry Petukhov via bitcoin-dev \u003c\n\u003e \u003e bitcoin-dev at lists.linuxfoundation.org\u003e wrote:\n\u003e \u003e\n\u003e \u003e \u003e В Thu, 11 Feb 2021 05:45:33 -0800\n\u003e \u003e \u003e Hugo Nguyen via bitcoin-dev \u003cbitcoin-dev at lists.linuxfoundation.org\u003e\n\u003e \u003e \u003e wrote:\n\u003e \u003e \u003e\n\u003e \u003e \u003e \u003e \u003e \u003e ENCRYPTION_KEY = SHA256(SHA256(TOKEN))\n\u003e \u003e \u003e \u003e \u003e\n\u003e \u003e \u003e \u003e \u003e This scheme might be vulnerable to rainbow table attack.\n\u003e \u003e \u003e \u003e \u003e\n\u003e \u003e \u003e \u003e\n\u003e \u003e \u003e \u003e Thank you for pointing this out! Incidentally, Dmitry Petukhov\n\u003e \u003e \u003e \u003e also told me the same privately.\n\u003e \u003e \u003e\n\u003e \u003e \u003e My thought was that if TOKEN has the characteristics of a password\n\u003e \u003e \u003e (short ASCII string), then it would be better to use key derivation\n\u003e \u003e \u003e function designed for passwords, like PBKDF2.\n\u003e \u003e \u003e\n\u003e \u003e \u003e The counter-argument to this is that this adds another code\n\u003e \u003e \u003e dependency for vendors, if the device firmware does not already\n\u003e \u003e \u003e have the required key derivation function.\n\u003e \u003e \u003e\n\u003e \u003e \u003e Maybe this could be solved by going into opposite direction - make\n\u003e \u003e \u003e the \"token\" even longer, use the mnemoic.\n\u003e \u003e \u003e\n\u003e \u003e \u003e The issue is that entering long data of the shared key into the\n\u003e \u003e \u003e device manually is difficult UX-wise.\n\u003e \u003e \u003e\n\u003e \u003e \u003e Hww vendors that allow to enter custom keys into their device\n\u003e \u003e \u003e already have to face this issue, and those who allow to enter\n\u003e \u003e \u003e custom keys via mnemonic probably tackled this somehow.\n\u003e \u003e \u003e\n\u003e \u003e \u003e Maybe the shared key for multisig setup can be entered in the same\n\u003e \u003e \u003e way ? (with maybe additional visual check via some fingerprint).\n\u003e \u003e \u003e\n\u003e \u003e \u003e Although we would then have another issue of potential confusion\n\u003e \u003e \u003e between two procedures (entering the main key and entering the\n\u003e \u003e \u003e shared key for multisig setup), and the measures has to be taken to\n\u003e \u003e \u003e prevent such confusion.\n\u003e \u003e \u003e\n\u003e \u003e \u003e The approaches can be combined - specify a key derivation function\n\u003e \u003e \u003e suitable for passwords; via secure channel, share a password and/or\n\u003e \u003e \u003e the derived key. If hww supports derivation function, it can derive\n\u003e \u003e \u003e the key from password. If hww supports only keys, the key can be\n\u003e \u003e \u003e entered raw or via mnemonic.\n\u003e \u003e \u003e _______________________________________________\n\u003e \u003e \u003e bitcoin-dev mailing list\n\u003e \u003e \u003e bitcoin-dev at lists.linuxfoundation.org\n\u003e \u003e \u003e https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev\n\u003e \u003e \u003e\n\u003e\n\u003e\n-------------- next part --------------\nAn HTML attachment was scrubbed...\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210212/0c8f1ab1/attachment-0001.html\u003e"}
