<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-11&#xA;📝 Original message:В Thu, 11 Feb 2021 05:45:33 -0800&#xA;Hugo Nguyen via bitcoin-dev &lt;bitcoin-dev at lists.linuxfoundation.org&gt;&#xA;wrote:&#xA;&#xA;&gt; &gt; &gt; ENCRYPTION_KEY = SHA256(SHA256(TOKEN))  &#xA;&gt; &gt;&#xA;&gt; &gt; This scheme might be vulnerable to rainbow table attack.&#xA;&gt; &gt;  &#xA;&gt; &#xA;&gt; Thank you for pointing this out! Incidentally, Dmitry Petukhov also&#xA;&gt; told me the same privately.&#xA;&#xA;My thought was that if TOKEN has the characteristics of a password&#xA;(short ASCII string), then it would be better to use key derivation&#xA;function designed for passwords, like PBKDF2.&#xA;&#xA;The counter-argument to this is that this adds another code dependency&#xA;for vendors, if the device firmware does not already have the required&#xA;key derivation function.&#xA;&#xA;Maybe this could be solved by going into opposite direction - make the&#xA;&#34;token&#34; even longer, use the mnemoic.&#xA;&#xA;The issue is that entering long data of the shared key into the device&#xA;manually is difficult UX-wise.&#xA;&#xA;Hww vendors that allow to enter custom keys into their device already&#xA;have to face this issue, and those who allow to enter custom keys via&#xA;mnemonic probably tackled this somehow.&#xA;&#xA;Maybe the shared key for multisig setup can be entered in the same way&#xA;? (with maybe additional visual check via some fingerprint).&#xA;&#xA;Although we would then have another issue of potential confusion&#xA;between two procedures (entering the main key and entering the shared&#xA;key for multisig setup), and the measures has to be taken to prevent&#xA;such confusion.&#xA;&#xA;The approaches can be combined - specify a key derivation function&#xA;suitable for passwords; via secure channel, share a password and/or the&#xA;derived key. If hww supports derivation function, it can derive the key&#xA;from password. If hww supports only keys, the key can be entered raw or&#xA;via mnemonic.</html></oembed>