<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:Thanks everyone who has provided inputs so far!&#xA;&#xA;This is the new proposal for the encryption aspect of the scheme, based on&#xA;all the feedback.&#xA;&#xA;The key derivation function would be PBKDF2, with PRF = SHA512. This should&#xA;be readily available on today&#39;s hardware already, as they are used for&#xA;BIP39.&#xA;&#xA;DK = PBKDF2(PRF, Password, Salt, c, dkLen)&#xA;PRF = SHA512&#xA;Pwd = HUMAN_READABLE_TITLE&#xA;Salt = NONCE&#xA;c = 2048&#xA;dkLen = 256&#xA;&#xA;HUMAN_READABLE_TITLE is in ASCII format, minimum length = 8, maximum length&#xA;= 20.&#xA;NONCE is a 64-bit number.&#xA;&#xA;Reason for going with SHA512 is due to legacy support on some hardware.&#xA;c=2048 also mimics BIP39. It takes about ~3 seconds to derive&#xA;the encryption key on a 80Mhz MCU. We feel like this is a good enough&#xA;tradeoff for this use case. The assumption here is that the secure session&#xA;is only needed temporarily for a few hours, maybe up to one day.&#xA;&#xA;The Coordinator and Signers agree and exchange these 2 secrets prior to the&#xA;setup. The NONCE can be converted to either:&#xA;(a) a 6-word phrase using BIP39 wordlist&#xA;(b) a 20-digit decimal number&#xA;(c) a QR code&#xA;&#xA;Depending on the vendor. This flexibility in the data format allows each&#xA;vendor to customize the UX based on their respective device capabilities.&#xA;&#xA;Best,&#xA;Hugo&#xA;&#xA;On Thu, Feb 11, 2021 at 8:25 AM Dmitry Petukhov via bitcoin-dev &lt;&#xA;bitcoin-dev at lists.linuxfoundation.org&gt; wrote:&#xA;&#xA;&gt; В Thu, 11 Feb 2021 05:45:33 -0800&#xA;&gt; Hugo Nguyen via bitcoin-dev &lt;bitcoin-dev at lists.linuxfoundation.org&gt;&#xA;&gt; wrote:&#xA;&gt;&#xA;&gt; &gt; &gt; &gt; ENCRYPTION_KEY = SHA256(SHA256(TOKEN))&#xA;&gt; &gt; &gt;&#xA;&gt; &gt; &gt; This scheme might be vulnerable to rainbow table attack.&#xA;&gt; &gt; &gt;&#xA;&gt; &gt;&#xA;&gt; &gt; Thank you for pointing this out! Incidentally, Dmitry Petukhov also&#xA;&gt; &gt; told me the same privately.&#xA;&gt;&#xA;&gt; My thought was that if TOKEN has the characteristics of a password&#xA;&gt; (short ASCII string), then it would be better to use key derivation&#xA;&gt; function designed for passwords, like PBKDF2.&#xA;&gt;&#xA;&gt; The counter-argument to this is that this adds another code dependency&#xA;&gt; for vendors, if the device firmware does not already have the required&#xA;&gt; key derivation function.&#xA;&gt;&#xA;&gt; Maybe this could be solved by going into opposite direction - make the&#xA;&gt; &#34;token&#34; even longer, use the mnemoic.&#xA;&gt;&#xA;&gt; The issue is that entering long data of the shared key into the device&#xA;&gt; manually is difficult UX-wise.&#xA;&gt;&#xA;&gt; Hww vendors that allow to enter custom keys into their device already&#xA;&gt; have to face this issue, and those who allow to enter custom keys via&#xA;&gt; mnemonic probably tackled this somehow.&#xA;&gt;&#xA;&gt; Maybe the shared key for multisig setup can be entered in the same way&#xA;&gt; ? (with maybe additional visual check via some fingerprint).&#xA;&gt;&#xA;&gt; Although we would then have another issue of potential confusion&#xA;&gt; between two procedures (entering the main key and entering the shared&#xA;&gt; key for multisig setup), and the measures has to be taken to prevent&#xA;&gt; such confusion.&#xA;&gt;&#xA;&gt; The approaches can be combined - specify a key derivation function&#xA;&gt; suitable for passwords; via secure channel, share a password and/or the&#xA;&gt; derived key. If hww supports derivation function, it can derive the key&#xA;&gt; from password. If hww supports only keys, the key can be entered raw or&#xA;&gt; via mnemonic.&#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt;&#xA;-------------- next part --------------&#xA;An HTML attachment was scrubbed...&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20210212/cb8584f3/attachment-0001.html&gt;</html></oembed>