Git Product home page Git Product logo

Comments (3)

chm-diederichs avatar chm-diederichs commented on August 17, 2024

s = SHA256(SHA256("LNPBP-1") || SHA256("LNPBP-1") || SHA256(msg))

The hashing of msg seems unnecessary here, s commits to every bit of msg either way. This step is also not included in the tagged hashes proposed in bip-schnorr.

I think we can get by just using s = H(H(tag) | H(tag) | msg)) and generate the tweak simply as H(s) instead of HMAC without having to worry about length extension attacks. In this case a length extension attack would need

H'(H(s), attack) = H(s | attack) === H(H(H(tag) | H(tag) | msg')) for some msg' != msg

However, since s is a hash, each bit depends on every bit of the input msg. This attack is therefore not a length extension attack, but a collision attack of finding h(m) = h(m') for m != m'. SHA256 provides 128bit* security against this, which is the upper bound for security in this case since collision attacks are always possible regardless of the hashing scheme.

*probably >128bit since there are constraints on both m and m'

from lnpbps.

chm-diederichs avatar chm-diederichs commented on August 17, 2024

ยง5.4.2 in Schneier's Cryptography Engineering provides a good discussion on the topic.
https://www.schneier.com/books/cryptography_engineering/

from lnpbps.

dr-orlovsky avatar dr-orlovsky commented on August 17, 2024

During LNPBPCon 0 in Milano in December a new version of LNPBP-1 was designed, which still have to be written as a standard (WIP)

from lnpbps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.