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