Closed arshidkv12 closed 5 years ago
A message can be up to 2^64 bit long, so there is no practical limit.
The number of messages encrypted with the same key must remain below 2^64, which is rarely an issue either.
Thank you... Can use this library for closed source project ? Like I will distribute only binary file.
Still, for very large files, chunking is recommended. If only to save memory, and avoid processing a 100 MB ciphertext, only to discover later that it is invalid/corrupted.
This is fairly easy to do with libhydrogen, using message identifiers. Set msg_id
to 0
for the first chunk, 1
for the second, etc. You can take a look at encpipe for an example implementation.
And yes, you can totally use this in a closed source project, commercial or not, provided that a copy of the license is present somewhere.
Is there any way to reduce key size ? Like 32 characters length key.
The key is 256 bits. That's 32 bytes.
This is supposed to be a high-entropy key, indistinguishable from random, not a password.
If you really need to use a password here, no matter what its length is, use a password hashing function first, to derive a suitable key from the password.
I want encrypt plain text file with short key. How it possible ?
Sorry for my basic questions.
Exactly as explained above: derive a key from the short key/password using hydro_pwhash_deterministic()
and use that key with hydro_secretbox_encrypt/decrypt()
.
Or look at encpipe.c; it does exactly that.
Thank you very much
What is the maximum length of message? Can I encrypt 100MB text file ?