Bitcoin Forum
May 10, 2026, 05:20:18 AM *
News: Latest Bitcoin Core release: 31.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Windows XP CryptGenRandom and Early Bitcoin  (Read 37 times)
f561bc6a712a (OP)
Newbie
*
Offline

Activity: 2
Merit: 0


View Profile
May 08, 2026, 08:12:49 AM
 #1

Hi,

I would like to share an ongoing empirical study of a historical random-generation path relevant to Bitcoin 0.1.5 on Windows:

Windows XP SP3 CryptGenRandom
→ OpenSSL 0.9.8h
→ Bitcoin 0.1.5

This is not presented as a practical attack against Bitcoin, nor as a claim that historical private keys can be derived.

For clarity, this work is not intended to facilitate, encourage, or justify any attempt to compromise historical wallets, private keys, or funds; any such use would be contrary to the purpose and scope of this research. On the contrary, by making a historically relevant randomness path more explicit, testable, and reproducible, the work aims to strengthen the technical understanding of Bitcoin’s early software environment and to reduce uncertainty rather than create risk.

The work should therefore be understood as a risk-reduction and uncertainty-reduction effort around the Satoshi-era discussion. Its purpose is to replace vague assumptions about the old Windows/OpenSSL/Bitcoin randomness chain with a documented experimental decomposition: what is observed, what is replayed bit-exactly offline, what is strongly constrained by traces, and what remains open.

The study reconstructs and instruments part of the Windows XP CryptGenRandom path using WinDbg/KD traces, paired memory captures, controlled experiments, and offline Python replay.

CryptGenRandom is a real deployed cryptographic component, not a purely theoretical construction. One interesting next step is to measure the diffusion impact after the VLH stage and then after the ADVAPI/SystemFunction036 path involving the eight round-robin RC4 states. Other measurements would also be relevant, including edge-case questions discussed in the literature on weak keys and entropy failures, such as boot-time entropy holes. These should be treated carefully as limit-case analyses, not as immediate claims about historical Bitcoin key compromise.

Several parts of the pipeline are experimentally closed or replayed bit-for-bit in the captured runs, including:

* the kernel-side pool → VeryLargeHashUpdate → seedbase_after transformation;
* the final rsaenh block from observed state20 and aux20 to out40;
* the final copy of the first 32 bytes to the CryptGenRandom caller buffer;
* parts of the ADVAPI/SystemFunction036 path, including an observed RC4 round-robin segment replayed from captured RC4 states.

A recent campaign also captured a complete long path with VLH and provider/FIPS activity in the same run; it confirms clean state20 propagation on the rsaenh side, while keeping the upstream G transformation explicitly open.

The main remaining open point is the upstream provider-state mapping leading to state20. In particular, state20 is not observed as a direct 20-byte window copied from seedbase_after, which is consistent with G being a transformation rather than a simple copy.

I think this matters for historical Bitcoin analysis because early Bitcoin on Windows depended on OpenSSL, and OpenSSL on Windows could incorporate CryptGenRandom into its RAND state. This does not imply that CryptGenRandom was the only source, nor that RAND_bytes directly called CryptGenRandom each time. But it makes the Windows XP RNG path historically relevant and worth documenting precisely.

As stated in the acknowledgments of the pre-publication, I am solely responsible for this work, including its experiments, interpretations, limitations, and any possible errors.

Pre-publication:
https://cnrs.hal.science/hal-05611907

Reproducibility artifacts:
https://github.com/Melik159/xp-cgr-replay

This does not alter Bitcoin’s protocol-level security; rather, it strengthens the historical analysis around early Bitcoin by reducing uncertainty about a real dependency in its early Windows software environment.

Technical comments, criticism, and independent review are welcome.
NotATether
Legendary
*
Offline

Activity: 2324
Merit: 9670


┻┻ ︵㇏(°□°㇏)


View Profile WWW
May 08, 2026, 09:37:42 AM
 #2

What is stopping a malicious user from using WinDbg to trace Bitcoin Core syscalls on later versions of Windows in order to extract private keys or the AES encryption state of the wallet password?

I don't think the developers even use WinDbg, they should block it from attaching to Windows version of Core.

 
 b1exch.to 
  ETH      DAI   
  BTC      LTC   
  USDT     XMR    
.███████████▄▀▄▀
█████████▄█▄▀
███████████
███████▄█▀
█▀█
▄▄▀░░██▄▄
▄▀██▄▀█████▄
██▄▀░▄██████
███████░█████
█░████░█████████
█░█░█░████░█████
█░█░█░██░█████
▀▀▀▄█▄████▀▀▀
f561bc6a712a (OP)
Newbie
*
Offline

Activity: 2
Merit: 0


View Profile
May 09, 2026, 01:00:51 PM
 #3

Hello,

Thank you for your interest and for your question / comment.

Allow me to respond, but it seems to me that if the individual in question already has access to the machine with all the necessary privileges, then the situation is already, in a sense, quite badly compromised.

WinDbg is not a Bitcoin Core vulnerability by itself.

If an attacker has enough local privileges to attach a debugger to the Bitcoin Core process, or to kernel-debug the Windows machine, then the security boundary has already been crossed. At that point, secrets present in memory may be observable regardless of whether Bitcoin Core tries to block a specific debugger.

Wallet encryption protects private keys at rest. It does not provide a guarantee against a fully compromised live system, especially while the wallet is unlocked, signing is taking place, or sensitive material is resident in process memory.

Bitcoin Core has had external security review, including an audit by Quarkslab:

https://blog.quarkslab.com/bitcoin-core-audit.html

But that does not change the local-compromise threat model. Anti-debugging measures such as blocking WinDbg are generally not a strong security boundary: they are bypassable, can interfere with legitimate debugging and crash analysis, and do not stop an attacker with administrator or kernel-level control.

So the issue is not really that “Bitcoin Core should block WinDbg”. The more fundamental point is that Bitcoin Core cannot be expected to protect wallet secrets against a malicious local administrator, a kernel debugger, or a compromised operating system. In that threat model, the host itself is no longer trusted.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!