Encrypt Decrypt File With Java

This is my homework for school. That java code decrpyts and encrpyts any file with converting file to a byte array and flipping random bits of that byte.

To decrypt it, saving the random number that flips desired bit of byte to the next index of that byte.