This command will take a random number between 1 and 4096 and use it to select the last N bytes of the file "file.txt" and write them to the file "output.txt".
shuf -i 1-4096 -n 1 | awk '{ print "tail -c "$1" < file.txt > output.txt"}' | sh