Coder Social home page Coder Social logo

Comments (3)

abacabadabacaba avatar abacabadabacaba commented on June 17, 2024 1

When developing cryptographic code, there are many ways to get it wrong without noticing. Many of the possible flaws cannot be found by testing, and the fact that some components (such as TweetNaCl) were audited doesn't say much about the security of the entire program.

Having said that, I believe that this specific combination of primitives (Ed25519 signature scheme and X25519 key agreement used by NaCl box) is not vulnerable to cross-protocol attacks. Moreover, both are secure individually. Thus, the way the keys are used here should be secure, however, a proper proof is needed to confirm this.

So, the reason for this notice is not because there are any weaknesses that we know about, but rather because this is an unverified cryptographic code which may have weaknesses that we don't know about.

from near-js-encryption-box.

sandoche avatar sandoche commented on June 17, 2024

Hi @VlodkoMr,

It's usually not recommended to store encrypted data on chain because there is a chance that in the future the encryption will be cracked (for example with quantum computing). So if you do so make sure you have ways to upgrade to a better encryption algorithm in the future in case this algorithm is at risk.

As concern the algorithm itself, near-js-encryption-box uses TweetNaCl which has been audited (https://tweetnacl.js.org/audits/cure53.pdf) which is a good thing.

Nevertheless in order to use TweetNaCl I had to convert the Ed25519 signing key pair into Curve25519, I used ed2curve-js to do so. If you check the ed2curve-js repo you can see the following statement:

Note that there's currently no proof that this is safe to do. It is safer to share both Ed25519 and Curve25519 public keys (their concatenation is 64 bytes long).

Before using it in production it would be wise to make an security audit.

Congrats on the chat app by the way!

from near-js-encryption-box.

VlodkoMr avatar VlodkoMr commented on June 17, 2024

Thank you!!!

from near-js-encryption-box.

Related Issues (1)

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.