<oembed><type>rich</type><version>1.0</version><author_name>npub1mtxs7jztn027d9cylej99hltqq9vq84uxm80zl4naxafd9hpxqwsj9g5zm</author_name><author_url>https://nostr.ae/npub1mtxs7jztn027d9cylej99hltqq9vq84uxm80zl4naxafd9hpxqwsj9g5zm</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2014-09-12&#xA;📝 Original message:&gt; What hash function would you recommend?&#xA;&#xA;Due to the properties of hash functions, you can just take the first x&#xA;bits of a SHA256 sum and they&#39;re pretty much as good as an equally&#xA;secure hash function of that length. In fact SHA512/224 and SHA512/256&#xA;are defined in that way (Plus different initial values because you&#xA;might as well do that when defining a standard).&#xA;&#xA;On Fri, Sep 12, 2014 at 10:36 AM, Andreas Schildbach&#xA;&lt;andreas at schildbach.de&gt; wrote:&#xA;&gt; On 09/12/2014 03:49 PM, Mike Hearn wrote:&#xA;&gt;&#xA;&gt;&gt; (1) Base64 of SHA256 seems overkill. 256 bits of hash is a lot. The risk&#xA;&gt;&gt; here is that a MITM intercepts the payment request, which will be&#xA;&gt;&gt; typically requested just seconds after the QR code is vended. 80 bits of&#xA;&gt;&gt; entropy would still be a lot and take a long time to brute force, whilst&#xA;&gt;&gt; keeping QR codes more compact, which impacts scannability.&#xA;&gt;&#xA;&gt; To put that into perspective, here is how a bitcoin: URI would look like:&#xA;&gt; bitcoin:?h=J-J-4mra0VorfffEZm5J7mBmHGKX86Dpt-TnnmC_fhE&amp;r=http://wallet.schildbach.de/bip70/r1409992884.bitcoinpaymentrequest&#xA;&gt; (obviously for real-world usage you would optimize the &#34;r&#34; parameter)&#xA;&gt;&#xA;&gt; I looked at the list in this doc to evaluate what&#39;s easily available:&#xA;&gt; https://code.google.com/p/guava-libraries/wiki/HashingExplained&#xA;&gt;&#xA;&gt; I thought SHA1 has a bad reputation these days, and we don&#39;t save much&#xA;&gt; by using it. I don&#39;t know anything about Murmur. MD5 is clearly broken.&#xA;&gt; What hash function would you recommend?&#xA;&gt;&#xA;&gt;&gt; (2) This should *not* be necessary in the common HTTPS context.&#xA;&gt;&#xA;&gt; It is. People can&#39;t check names. People don&#39;t want to check names.&#xA;&gt; People can&#39;t get certificates for lots of reasons. X.509 is centralized.&#xA;&gt; X.509 has had serious security issues in the past. And shit continues to&#xA;&gt; happen.&#xA;&gt;&#xA;&gt; To sum up, X.509 can&#39;t replace the trust anchor that is established by&#xA;&gt; scanning a QR code or tapping two devices together.&#xA;&gt;&#xA;&gt;&gt; (3) This can be useful in the Bluetooth context, but then again, we&#xA;&gt;&gt; could also do things a different way by signing with the key in the&#xA;&gt;&gt; first part of the URI, thus avoiding the need for a hash.&#xA;&gt;&#xA;&gt; Sure. But signing is harder than just calculating a hash.&#xA;&gt;&#xA;&gt;&#xA;&gt;&#xA;&gt; ------------------------------------------------------------------------------&#xA;&gt; Want excitement?&#xA;&gt; Manually upgrade your production database.&#xA;&gt; When you want reliability, choose Perforce&#xA;&gt; Perforce version control. Predictably reliable.&#xA;&gt; http://pubads.g.doubleclick.net/gampad/clk?id=157508191&amp;iu=/4140/ostg.clktrk&#xA;&gt; _______________________________________________&#xA;&gt; Bitcoin-development mailing list&#xA;&gt; Bitcoin-development at lists.sourceforge.net&#xA;&gt; https://lists.sourceforge.net/lists/listinfo/bitcoin-development</html></oembed>