Git Product home page Git Product logo

Comments (3)

fiatjaf avatar fiatjaf commented on August 11, 2024 1

Also, are relays supposed to verify the signature? Or only the end clients?

Everybody is supposed to verify, but it's your choice. If you don't verify you risk becoming a bad actor that spreads fake data and not being used by anyone eventually.

from nostr.

Pranoy1c avatar Pranoy1c commented on August 11, 2024

To my first question, I think I found the answer here:

https://crypto.stackexchange.com/questions/15295/why-the-need-to-hash-before-signing-small-data

If you do not hash the data before signing you cannot have one consistent signature algorithm, because you could only sign messages up to a certain size and if the size of the message gets too large you would need to hash. But that is not a good practice for signature schemes. More importantly, there are signature schemes which can easily be forged when the data is not hashed, such as RSA, see my answer here. In order to have security independent of the size of the signed message, we typically use this hash-then-sign paradigm, i.e., hash the plain message before performing signing operations on it, and thus the signature algorithm works for any size of the message and we do not really have to care about the message size.

Can you answer the second question?

from nostr.

milahu avatar milahu commented on August 11, 2024

are relays supposed to verify the signature?

i guess no, this would be a waste of cpu time

i guess yes, this makes everything simpler.
broken data is detected early, and is not stored/forwarded

from nostr.

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.