GithubHelp home page GithubHelp logo

Comments (6)

paragonie-security avatar paragonie-security commented on June 12, 2024 2

XChaCha20 has a 192-bit nonce instead of a 96-bit nonce, which changes the risk of random nonce collision to "roughly one in a billion after a few billion messages" to "virtually never".

from halite.

paragonie-security avatar paragonie-security commented on June 12, 2024 1

do you know if switching from XSalsa20 to ChaCha20 in halite code is as simple as just replacing encrypt / decrypt / generating key / constants for nonces etc, and keep the key derivation & authentication just like it is already coded?

We generally don't recommend making changes to Halite. We're already planning on switching the stream cipher in v5.

from halite.

paragonie-security avatar paragonie-security commented on June 12, 2024

We aren't going to ever switch to ChaCha20. We might switch to XChaCha20.

We're investigating other changes for Halite 5, which will almost certainly stop using Xsalsa20 and target PHP 8.1 and newer.

from halite.

anthony-o avatar anthony-o commented on June 12, 2024

Thank you for your answer. Any reason to choose XChaCha20 against ChaCha20?

from halite.

anthony-o avatar anthony-o commented on June 12, 2024

OK thank you for those explanations.

Anyway, as I'm working for a project that must follow the guide I initially posted in this thread, I must encrypt my app data using ChaCha20 and I didn't find other serious high level crypto library in PHP that would do this "the good way" (except using AES implementation by defuse but it is faaaar slower that halite symmetric encryption using XSalsa20 (more that 700 times slower) or my modified version using ChaCha20).

As you seem to have knowledge @paragonie-security , do you know if switching from XSalsa20 to ChaCha20 in halite code is as simple as just replacing encrypt / decrypt / generating key / constants for nonces etc, and keep the key derivation & authentication just like it is already coded?

I could perhaps post a PR (which obviously would not be accepted as it is not planned for halite to switch to ChaCha20) in this "issue" in order to better illustrate what I did?

from halite.

paragonie-security avatar paragonie-security commented on June 12, 2024

Done in #176 :)

from halite.

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.