We have found files encoded using XOR Encryption, but Im newbie on JAVA, please how to decrypt XOR using this xor encoder.
The code is generating a random int (4 bytes) and using it to XOR the input - it is not asking for the encryption key, it is generating it randomly. Unless the receiver has some way of knowing what the next random int is, it will not be able to decode. EG, perhaps the sender and receiver are expected to initialize their random generators with the same seed value when they start up. Regardless, it is not a real encryption algorithm, just another example of some half-cocked idea someone invented in their head. You really need to replace this code with a correct usage of encryption.