Trypticon
Newbie
- Apr 25, 2025
- 12
- 9
Just something I am working on...
Idea: using your hardware metrics (Performance Counters) to generate a unique temp algorithm
Use case: generate "unhackable" unique PW or Blockchain
Pull metrics from Windows Performance Counters using:
WMI (Windows Management Instrumentation)
Querying Win32_PerfFormattedData_PerfOS_Processor to get CPU load.
PDH API (Performance Data Helper) – A C/C++ interface to performance counters.
PowerShell
Get-Counter '\Processor(_Total)\% Processor Time'
.NET / Python Libraries
.NET: System.Diagnostics.PerformanceCounter
Python: psutil, wmi, or pywin32 to tap into performance counters.
2. Structure the Data
Real-time time series:
Metrics: CPU %, RAM usage, disk I/O, GPU temp, etc.
Format: Timestamped JSON or tabular (Pandas DataFrame style).
Frequency: Every X seconds (every 1s for live data).
3. Create the "Temporary Algorithm"
Anomaly Detection (something spiking or overheating?)
Z-score, rolling average, or more complex like Isolation Forest.
Trend Prediction (CPU temp trajectory)
Basic: Moving average, exponential smoothing
Advanced: Linear regression or LSTM (RNN).
Event Triggering (e.g., alert when RAM > 90%)
Simple rule-based logic
4. Visualize or Output
Send this data to:
A live dashboard (e.g., using Python with matplotlib, plotly, or stream it via Flask)
Log it for later (CSV, SQLite)
>>>Basic Loop (Pseudocode in Python style)<<
while True:
cpu = get_cpu_usage() # via psutil or WMI
temp = get_cpu_temp() # if supported
memory = get_memory_usage()
timestamp = now()
analyze(cpu, temp, memory) # your "temporary algorithm"
time.sleep(1) # sample rate
Blockchain "Proof of Metrics" concept
Each node submits its own system stats
Blocks are generated based on those stats
You invent a consensus model around, say, the most stable system
>>>Potential Python script<<<
import hashlib
import time
import psutil
from datetime import datetime
class Block:
def __init__(self, index, timestamp, cpu_usage, previous_hash):
self.index = index
self.timestamp = timestamp
self.cpu_usage = cpu_usage
self.previous_hash = previous_hash
self.hash = self.calculate_hash()
def calculate_hash(self):
block_string = f"{self.index}{self.timestamp}{self.cpu_usage}{self.previous_hash}"
return hashlib.sha256(block_string.encode()).hexdigest()
def __str__(self):
return f"Block #{self.index} | CPU: {self.cpu_usage}% | Hash: {self.hash[:10]}..."
class Blockchain:
def __init__(self):
self.chain = [self.create_genesis_block()]
def create_genesis_block(self):
return Block(0, datetime.utcnow().isoformat(), 0.0, "0")
def get_latest_block(self):
return self.chain[-1]
def add_block(self, cpu_usage):
latest_block = self.get_latest_block()
new_block = Block(
index=latest_block.index + 1,
timestamp=datetime.utcnow().isoformat(),
cpu_usage=cpu_usage,
previous_hash=latest_block.hash
)
self.chain.append(new_block)
def is_chain_valid(self):
for i in range(1, len(self.chain)):
prev = self.chain[i - 1]
curr = self.chain
if curr.previous_hash != prev.hash:
return False
if curr.hash != curr.calculate_hash():
return False
return True
def main():
system_chain = Blockchain()
print("Starting CPU-Usage Blockchain...")
try:
for _ in range(5): # Add 5 blocks (one per second)
cpu = psutil.cpu_percent(interval=1)
system_chain.add_block(cpu)
print(system_chain.get_latest_block())
print("\n Blockchain valid:", system_chain.is_chain_valid())
except KeyboardInterrupt:
print("Stopped.")
if __name__ == "__main__":
main()
To generate a more complex algorithm for Blockchain the following metrics can be pulled
a. Hardware-Level Identifiers (Semi-Unique Fingerprinting)
Motherboard serial
BIOS version
MAC address
UUID of the system
Disk serial number
b. Power & Thermal Metrics (Dynamic, Entropy-Like)
Power draw in watts (CPU, GPU, system total)
CPU core voltages
Fan speeds / thermal throttling flags
Temperature curves
Idea: using your hardware metrics (Performance Counters) to generate a unique temp algorithm
Use case: generate "unhackable" unique PW or Blockchain
1. Access the Data SourcePull metrics from Windows Performance Counters using:
WMI (Windows Management Instrumentation)
Querying Win32_PerfFormattedData_PerfOS_Processor to get CPU load.
PDH API (Performance Data Helper) – A C/C++ interface to performance counters.
PowerShell
Get-Counter '\Processor(_Total)\% Processor Time'
.NET / Python Libraries
.NET: System.Diagnostics.PerformanceCounter
Python: psutil, wmi, or pywin32 to tap into performance counters.
2. Structure the Data
Real-time time series:
Metrics: CPU %, RAM usage, disk I/O, GPU temp, etc.
Format: Timestamped JSON or tabular (Pandas DataFrame style).
Frequency: Every X seconds (every 1s for live data).
3. Create the "Temporary Algorithm"
Anomaly Detection (something spiking or overheating?)
Z-score, rolling average, or more complex like Isolation Forest.
Trend Prediction (CPU temp trajectory)
Basic: Moving average, exponential smoothing
Advanced: Linear regression or LSTM (RNN).
Event Triggering (e.g., alert when RAM > 90%)
Simple rule-based logic
4. Visualize or Output
Send this data to:
A live dashboard (e.g., using Python with matplotlib, plotly, or stream it via Flask)
Log it for later (CSV, SQLite)
>>>Basic Loop (Pseudocode in Python style)<<
while True:
cpu = get_cpu_usage() # via psutil or WMI
temp = get_cpu_temp() # if supported
memory = get_memory_usage()
timestamp = now()
analyze(cpu, temp, memory) # your "temporary algorithm"
time.sleep(1) # sample rate
Blockchain "Proof of Metrics" concept
Each node submits its own system stats
Blocks are generated based on those stats
You invent a consensus model around, say, the most stable system
>>>Potential Python script<<<
import hashlib
import time
import psutil
from datetime import datetime
class Block:
def __init__(self, index, timestamp, cpu_usage, previous_hash):
self.index = index
self.timestamp = timestamp
self.cpu_usage = cpu_usage
self.previous_hash = previous_hash
self.hash = self.calculate_hash()
def calculate_hash(self):
block_string = f"{self.index}{self.timestamp}{self.cpu_usage}{self.previous_hash}"
return hashlib.sha256(block_string.encode()).hexdigest()
def __str__(self):
return f"Block #{self.index} | CPU: {self.cpu_usage}% | Hash: {self.hash[:10]}..."
class Blockchain:
def __init__(self):
self.chain = [self.create_genesis_block()]
def create_genesis_block(self):
return Block(0, datetime.utcnow().isoformat(), 0.0, "0")
def get_latest_block(self):
return self.chain[-1]
def add_block(self, cpu_usage):
latest_block = self.get_latest_block()
new_block = Block(
index=latest_block.index + 1,
timestamp=datetime.utcnow().isoformat(),
cpu_usage=cpu_usage,
previous_hash=latest_block.hash
)
self.chain.append(new_block)
def is_chain_valid(self):
for i in range(1, len(self.chain)):
prev = self.chain[i - 1]
curr = self.chain
if curr.previous_hash != prev.hash:
return False
if curr.hash != curr.calculate_hash():
return False
return True
def main():
system_chain = Blockchain()
print("Starting CPU-Usage Blockchain...")
try:
for _ in range(5): # Add 5 blocks (one per second)
cpu = psutil.cpu_percent(interval=1)
system_chain.add_block(cpu)
print(system_chain.get_latest_block())
print("\n Blockchain valid:", system_chain.is_chain_valid())
except KeyboardInterrupt:
print("Stopped.")
if __name__ == "__main__":
main()
To generate a more complex algorithm for Blockchain the following metrics can be pulled
a. Hardware-Level Identifiers (Semi-Unique Fingerprinting)
Motherboard serial
BIOS version
MAC address
UUID of the system
Disk serial number
b. Power & Thermal Metrics (Dynamic, Entropy-Like)
Power draw in watts (CPU, GPU, system total)
CPU core voltages
Fan speeds / thermal throttling flags
Temperature curves