Giter VIP home page Giter VIP logo

Comments (3)

tarcieri avatar tarcieri commented on September 24, 2024

As a general policy, we should have information on that, and presently don't, which is bad.

That said, I will follow up with you via private email to discuss possible options.

from stream-ciphers.

tarcieri avatar tarcieri commented on September 24, 2024

I'll go ahead and disclose this issue, saying up front that in my assessment it does not impact users of the chacha20poly1305 crate (main vicarious users of this crate today), which honors the maximum plaintext length (P_MAX) described in RFC 8439 Section 2.8 and therefore should prevent this issue:

https://github.com/RustCrypto/AEADs/blob/master/chacha20poly1305/src/cipher.rs#L55

Anyone using the chacha20 crate directly through the SyncStreamCipher and SyncStreamCipherSeek APIs can potentially overflow the 32-bit counter value, leading to nonce reuse. This would occur after encrypting 2^32 blocks of data (~256GB), or seeking to a point in the keystream where the counter overflows, leading to nonce reuse.

This crate has a chacha20::MAX_BLOCKS constant set to the correct value, however it isn't honored when using the stream-cipher traits.

I'm disclosing in advance with it unpatched because of both the low exploitability and relatively small number of non-chacha20poly1305 usages of this crate.

I will prepare a small fix, do another release, and also file a RustSec issue about it.

from stream-ciphers.

tarcieri avatar tarcieri commented on September 24, 2024

I just released a stopgap fix for this which panics in chacha20 v0.2.3, and yanked all previous releases of the chacha20 crate.

I opened #70 to track adding a falliable API to salsa20-core to avoid panicking in these situations.

from stream-ciphers.

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.