Java Generate Random Bytes using Apache Commons Crypto In this Java tutorial we learn how to generate a random byte[] array in Java application using Apache Commons Crypto library.