-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow shake128/256 to produce outputs of unlimited length #54406
Comments
Allowing the |
Alternatively, a new method like |
Hi! Could you provide some example code of what it is that you are looking for? |
I don't think there's much we can do here until |
I'm actually writing a Node.js version of the Xray-core library, which is an encryption proxy tool. Living in mainland China, it's an important tool for me. The library is poorly written; it implements a proxy protocol called VMess. In one part, it uses SHAKE128 to generate an infinite byte stream and XORs this stream with plaintext data to transmit over the network. This is definitely a misuse, as it incorrectly applies a hash algorithm as a stream cipher. However, I'm just replicating the existing protocol and need to find a function that supports this usage. This is a quote from the original code. https://github.com/XTLS/Xray-core/blob/main/proxy/vmess/encoding/auth.go
|
Side note: it's not an approved usage of an XOF, but it's not known to be vulnerable in Keccak's sponge construction either. It even was suggested in the 2011 paper on sponge function but has not been approved so far. In many ways, SHAKE is not a hash function but rather an XOF. |
What is the problem this feature will solve?
SHAKE128 is essentially a hash algorithm that can output an infinite-length stream. Rather than being just a hash algorithm, it's more like a stream cipher such as RC4. Support for SHAKE128/256 is currently available, but the implementation requires specifying an
outputSize
in advance, which is fixed and limited. This doesn't meet my needs, so I have to rely on third-party libraries.What is the feature you are proposing to solve the problem?
Support for SHAKE was first introduced in 2019, but I believe this support is incomplete.
#28757
#28805
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: