Didier Stevens

Friday 21 November 2025

Quickpost: Power Requirements Of A Keylogger

Filed under: Hardware,Quickpost — Didier Stevens @ 0:00

I did some tests with a Keelog keylogger, the AirDrive Forensic Keylogger: I wanted to find out how much power that keylogger requires.

This is my test setup:

  1. This is the USB keyboard
  2. The USB cable of the keyboard is plugged into the USB breakout board
  3. This is the USB breakout board, allowing me to measure the voltage and current of the USB power lines
  4. This is specialized multimeter that can measure power (by measuring voltage and current simultaneously)
  5. The USB cable of the USB breakout board is plugged into a USB extension cable that is plugged into a computer

In this standby state, with all its LEDs turned of, the keyboard consumes 11 mW.

That’s not much power. Compare this with the Numlock LED turned on, and we have 4 times as much: 47 mW:

And here I have the keylogger plugged in (between the keyboard and the USB breakout board):

Now the total power measured is 383 mW: that’s for the keyboard (with LEDs turned off) and the keylogger.

That’s a huge difference with 11 mW for a keyboard without keylogger.

If this keylogger would be hidden into the keyboard, it would be easily detected using this measurement method, because this particular keyboard requires 30+ times less power than the keylogger itself.


Quickpost info

Sunday 6 July 2025

Quickpost: 12V Portable Power Station

Filed under: Hardware,Quickpost — Didier Stevens @ 9:18

In blog post “My Fridge & My Portable Power Station” I managed to get a maximum of 778 Wh out of my portable power station with a rated capacity of 1260 Wh.

Thinking that quite some power got lost in the AC inverter, I set out to measure the amount of power I can get with its 12V DC output.

I configured my electronic load to draw 5 A:

The portable power station displayed 65 W output:

And I only got 673 Wh out of it:

That’s even worse than for 230V with the inverter: 53% of the rated capacity.


Quickpost info

Wednesday 2 July 2025

Quickpost: Doorbell & Condensation

Filed under: Hardware,Quickpost — Didier Stevens @ 0:00

Remember that I broke the filament of the light-bulb in my doorbell?

Turns out there is another advantage to having a light-bulb in your doorbell: it prevents condensation:


Quickpost info

Tuesday 10 June 2025

My Fridge & My Portable Power Station

Filed under: Hardware — Didier Stevens @ 0:00

You probably heard about the blackout in Spain & Portugal that happened more than a month ago at the time I’m writing this, and is still under investigation to find out the root cause.

It inspired me to do the following test: how long will my fridge run when powered by my power station. I own a portable power station (Ecoflow Delta EU), its batteries have a total capacity of 1260 Wh.

My fridge consumes 1,72W in standby and about 27W when the motor is running. Here is a graph of the power it consumes while running over a period of 24 hours:

On average, it requires 529 Wh per day to run.

So I was thinking, theoretically, it should run a bit more than 2 days (1260 Wh / 529 Wh per day = 2,38 days) when powered by my power station.

In practice, it ran just shy of 24 hours before my power station was depleted:

It consumed 266 Wh. Which is far less then the capacity of the batteries in the power station (1260 Wh).

How can this be explained?

My first idea was maybe it’s because of the inductive load (it’s a motor). The power factor is very low (0.06):

I was thinking: maybe the 230V inverter in my power station is not efficient at handling inductive loads.

So I tried with a pure resistive load (an incandescent light bulb of 60W):

I got 595 Wh. Which is still far less than 1260 Wh.

Then I tried with a fan that requires 21W at a power factor of 0.70:

I got 362 Wh:

I started to reformulate my hypothesis: me it’s not the low power factor that make the inverter inefficient, but maybe it’s inefficient at low power demands.

Because while this fan requires 21W, the power station was displaying 31W :

So I did run the fan again, but now with the resistive heating element powered on, so that it would consume a large amount of power (around 1 kWh, that’s the maximum sustained load my power station can handle):

I got 778 Wh out of it:

So that’s the best my power station can deliver at a maximum sustained load of 1 kWh and a nearly pure resistive power factor of 0.99.

Which is only 62% of the rated battery capacity.

Conclusion: I can power my fridge for 1 day in case of a power outage, which should be ample enough in case of a power outage similar to the Spain & Portugal incident. But it’s far from efficient. Inverters seem to very less efficient at very low loads.

Sunday 8 June 2025

Quickpost: USB-C Couplers

Filed under: Hardware — Didier Stevens @ 0:00

I have this USB C coupler to connect 2 USB C cables. The coupler has 2 female connectors:

I use it to extend my cables when charging:

But it doesn’t always work. Sometimes it does, sometimes it doesn’t (e.g., the device is not charging).

So I assumed this coupler was defective, and got another one:

This one has a small LED, and it too wouldn’t always work.

But because of the LED, I quickly figured it out:

If the LED isn’t on (e.g., not current is flowing), I just have to flip one of the male connectors 180°. Then it works.

And that’s what I also have to do with the first coupler I got: if it doesn’t work, flip one of the connectors. I just needed a LED to figure this out đŸ™‚


Quickpost info

Wednesday 16 April 2025

Quickpost: Testing The Capacity Of My New Power Bank

Filed under: Hardware,Quickpost — Didier Stevens @ 0:00

I bought a new power bank (Anker PowerCore 533, capacity 10.000 mAh 36 Wh, 30 Watt Power Delivery) and did some tests that I’m summarizing here.

Charging it with a generic USB C charger capable of delivering 20 W PD required 46,979 Wh. That’s measured on the 230V side, thus including the loss in the charger.

Charging it with a Anker 737 Charger (GaNPrime 120W) required 45,515 Wh.

Discharging the power bank via the USB A port connected to an electronic load gave me:

  • 30,970 Wh (6516 mAh ) when drawing 0,5A
  • 29,362 Wh (6523 mAh) when drawing 1,0A

30 Wh compared to 36 Wh (the advertised capacity of the power bank) is 83,33%, which is much better than what Anker estimates you can get out of a power bank (60% to 70%).

As I couldn’t get more than 1,0A out of the power bank via the USB A port, I used the USB C port with a trigger module to deliver 20,0V.

The electronic load drew 1,250A and measured around 18,6V, or 23,25W. I got 29,020 Wh (1557 mAh) out of it.

The power bank became hot while getting completely drained at 23W:

You can see the outline of the cells and the electronic circuit (it’s the hottest: white).

I couldn’t immediately recharge my power bank after that, I had to let it cool down (“Let the power bank cool down before use”):

I also tried to get more out of the power bank by drawing 1,5A at 18,55V or 27,82W (advertized maximum is 30W).

But after 34 minutes (delivering 15,670 Wh) it stopped delivering power and displayed the following message (“Use after protection removal”):

I guess that’s the overcurrent protection kicking in. I’m not sure why this happened, as the electronic load was in constant current mode.

I had to disconnect the cable to use the power bank again.

And finally, this power bank is capable of trickle charging: delivering a very low current for about two hours. You enable this mode by pushing the button twice.

I configured the electronic load to draw a really low current of 0,005A (it measured 0,003A) from the USB A port and it delivered 0,032 Wh (6 mAh) over a period of 2:01:05 after which it shut down automatically (as advertized).


Quickpost info

Sunday 30 March 2025

Quickpost: Electrical Power & Mining: Dissipated Heat

Filed under: Hardware,Quickpost — Didier Stevens @ 0:00

I got an interesting question on my blog post “Quickpost: Electrical Power & Mining“:

Does the temperature in your room increase due to the miner running full blast? Would you turn down the heater to compensate (which may change the calculation slightly).

That was indeed the case: I did turn down the heating in the room, and the heat of the desktop computer made it a nice 20°C.

We heat our home with natural gas, and on that day, we consumed 2,23 cubic meters to heat the rooms in our house, except for the office where the computer was running. Counting the volumes of the rooms, I estimate that 0,55 cubic meters would have been necessary to heat the office.

Using that same spreadsheet, consuming an extra 0,55 cubic meter would cost me €0,55. Deducting this from the €3,91 I had to spend on electricity gives me €3,36, which is still around 10 times more than the €0,39 I earned through mining.


Quickpost info

Monday 10 February 2025

Quickpost: Electrical Power & Mining

Filed under: Hardware,Quickpost — Didier Stevens @ 0:00

I was wondering: how costly is crypto mining for me?

I let an easy-to-use mining application run on my desktop computer (RTX 3080 GPU) for 24 hours.
After 24 hours, the miner reported that I had mined 0,00000365 BTC, and that this would earn me €0,39. The electrical power consumption of my desktop computer for that period was 13,024 kWh.

How much does 13 kWh cost me? Here in Belgium, we pay a lot of taxes on our utility bill. So just multiplying 13 kWh with the cost for 1 kWh would not produce realistic costs.
What I did instead: I took my utility bill of December 2024, with all the taxes, and created a spreadsheet that re-calculates all of the costs and taxes. That gives me a spreadsheet were I can simulate changes to my bill and see what the final result is. And with that spreadsheet, I increased my electrical power consumption for December 2024 with 13,024 kWh. That gave me an extra cost of €3,91.

Spending €3,91 to earn €0,39 is not viable at all.

But what if I would run the miner only when my solar panels produce enough power? That’s free electricity, right?

Yes, but … my electricity supplier also pays me money for the solar power I produce and don’t consume (e.g., inject).
Injecting 13,024 kWh would earn me €0,86. So that’s at least double the amount that mining would earn me.

Conclusion: as long as electricity tariffs don’t change significantly, mining is not financially viable for me. One would be better of buying BTC with the small payouts for injected power.


Quickpost info

Friday 22 November 2024

Interfacing With A Cheap Geiger Counter

Filed under: Hardware,My Software — Didier Stevens @ 0:00

I got a cheap Geiger counter from Aliexpress:

This picture was taken on an airplane: you have more radiation (cosmic rays) at high altitude.

I figured out how to interface with this counter in Python to log real time data:

#!/usr/bin/env python

from __future__ import print_function

__description__ = "Program for geiger meter"
__author__ = 'Didier Stevens'
__version__ = '0.0.1'
__date__ = '2024/05/11'

"""

Source code put in the public domain by Didier Stevens, no Copyright
https://DidierStevens.com
Use at your own risk

History:
  2024/05/11: start

Todo:
"""

import optparse
import serial
import time

def FormatTime(epoch=None):
    if epoch == None:
        epoch = time.time()
    return '%04d%02d%02d-%02d%02d%02d' % time.localtime(epoch)[0:6]

def FindCOMPorts():
    ports = []
    for number in range(1, 10):
        try:
            comport = 'COM%d' % number
            with serial.Serial(comport) as oSerial:
                ports.append(comport)
        except serial.serialutil.SerialException as e:
            if 'PermissionError' in e.args[0]:
                ports.append(comport)
    return ports

def LogToCSV(comport):
    ser = serial.Serial(comport, 115200, timeout=0, write_timeout=0)
    ser.write(b'\xAA\x05\x0E\x01\xBE\x55\x00')
    alldata = b''
    fOut = open('geiger.csv', 'a')
    while True:
        data = ser.read(1000)
        if data != b'':
            alldata += data
            lines = alldata.split(b'\xaaU\x0e')
            alldata = lines[-1]
            lines = lines[:-1]
            for line in lines:
                if line != b'':
                    out = FormatTime() + ';' + line.decode('latin')
                    print(out)
                    fOut.write(out + '\n')
            if alldata.endswith(b'U') and not alldata.endswith(b'\xaaU'):
                out = FormatTime() + ';' + alldata.decode('latin')
                print(out)
                fOut.write(out + '\n')
                alldata = b''
            time.sleep(0.40)

def Main():
    oParser = optparse.OptionParser(usage='usage: %prog [options]\n' + __description__ , version='%prog ' + __version__)
    oParser.add_option('-l', '--listports', action='store_true', default=False, help='List ports')
    (options, args) = oParser.parse_args()

    comports = FindCOMPorts()
    if options.listports:
        print('Available ports:')
        for comport in comports:
            print(' %s' % comport)
        return

    if len(args) == 1:
        LogToCSV(args[0])
    elif len(comports) == 1:
        print('Using %s' % comports[0])
        LogToCSV(comports[0])
    else:
        print('Provide the COM port as argument')
        print('Available ports:')
        for comport in comports:
            print(' %s' % comport)

if __name__ == '__main__':
    Main()

Thursday 21 November 2024

Quickpost: The Electric Energy Consumption Of A Soundbar

Filed under: Hardware,Quickpost — Didier Stevens @ 0:00

I have a Samsung Neo QLED 65 inch TV.

Its standby power consumption is pretty good: 1,3 Watt.

It comes with a soundbar, and its standby power consumption is pretty awful: 5,5 Watt!


Quickpost info

« Previous Page — Next Page »

Blog at WordPress.com.