CryptGenRandom[1] or RtlGenRandom[2].  Although CryptGenRandom is the offical version they probably would rather you use I&#x27;m fairly certain that most people are more likely to use RtlGenRandom because it&#x27;s accessing the same thing but doesn&#x27;t require a CSP context in order to use it (you can just call it straight up).<p>You have to include ntsecapi.h with some fixing definitions[3] to use RtlGenRandom.<p>[1] <a href="https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;aa379942(v=vs.85).aspx" rel="nofollow">https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;aa3...</a><p>[2] <a href="https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;aa387694(v=vs.85).aspx" rel="nofollow">https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;windows&#x2F;desktop&#x2F;aa3...</a><p>[3] <a href="https:&#x2F;&#x2F;boringssl.googlesource.com&#x2F;boringssl&#x2F;+&#x2F;master&#x2F;crypto&#x2F;rand&#x2F;windows.c#26" rel="nofollow">https:&#x2F;&#x2F;boringssl.googlesource.com&#x2F;boringssl&#x2F;+&#x2F;master&#x2F;crypto...</a>