Hi.. I have a question.. My teacher gave me an assignment to encrypt files using RSA.. I understand the system very well.. I converted the file to byte[].. And when I do the encryption, I get values larger than the values permitted for the type byte and the program stops.. Is there any way to avoid that?

2 solutions

Solution 1

You can't possibly get values larger than byte if you were doing the encryption properly. Now, if you created an array of bytes to hold the resulting encrypted data, THEN you might get some kind of array overflow.

Without seeing your code, it's impossible to tell you what you did wrong.

I see, thank you for the explanation of what could be perceived as "overflow"; this is just the usual wrapping of the value of the maximum. I only say that this "overflow" has nothing to do with the validity of encryption.
—SA