The stochastic nature of the switching mechanism of phase-change memory (PCM) arrays, which is a drawback for memory applications, can fruitfully be exploited to implement primitives for hardware security. By applying a set voltage pulse, whose amplitude corresponds to a switching probability of 50%, to a memory array initially placed in the full-reset state, half of the memory bits are statistically switched and programmed to state '1,' whereas the remainder of the bits persist in state '0.' Such a natural randomness can be exploited to create a true random number generator (TRNG), which is the building block of cryptographic applications. The feasibility of a TRNG by means of self-heating PCM cells is assessed and demonstrated through simulations based upon the random network model, i.e., a microscopic transport model previously developed and tested by the authors