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