I would like to know whether mcrypt output would be the same on Windows and Ubuntu or is the encryption affected by the underlying operating system?
The whole point of standardising encryption algorithms is that they should work the same no matter what platform they're implemented on.