in reply to generating random blocks of data...
It's important to understand that the above methods really generate psuedo random numbers. If you need strong (nondeterministic) random numbers, you need something like /dev/random and /dev/urandom. Short of this, you will need to obtain/create an entropy gathering process to handle this for you.