suggestion for using strlen()
Hi guys,
Can i use to find the length of binary data...?
My undetstanding is that strlen() will consider "\0" as the end of the data.
But my confusion is like , if the data is encrypted , can we trust strlen()..???
thanks in advance
Re: suggestion for using strlen()
You can't use strlen(), for the reason you already gave. When receiving encrypted data, you will have to have some prior knowledge on the amount of data you're (supposed to be) receiving. E.g.: uuEncoding specifies the line length in the first byte of each line, or yEncoding, that uses a terminator sequence that marks the end of the encoded data stream.
Re: suggestion for using strlen()
I am using "RC4 encryption " algorithm .So my questions are ,
1) Will RC4 algorithm added '\0' ( ie: null character ) at the end of encrypted data.
2) Will RC4 algorithm assure that it will not add '\0' in between encrypted data ,except at the end of the encrypted data
please help me
Re: suggestion for using strlen()
You can find the answer for example on Wikipedia. Short answers:
1) No
2) No
Longer answers:
1) Depends on the implementation of the algorithm, but generally, no.
2) Depends on the input and implementation of the encrypting algorithm.
DISCLAIMER: I infer these answers from a quick scan of the Wikipedia page, so correct me if I'm wrong...