Didier Stevens

Saturday 6 December 2025

Quickpost: USB-C Rechargeable Batteries

Filed under: Hardware,Quickpost — Didier Stevens @ 10:52

I discovered USB-C rechargeable batteries, and bought a set of AA and AAA batteries.

They have a USB-C connector for recharging, so you don’t need a separate charger like you do for NiMH batteries.

This post is not a full blog post, but more a collection of lab notes.

These USB-C batteries deliver 1,5 Volt (unlike NiMH batteries that deliver 1,3 Volt). And during discharge tests, I noticed that the voltage almost doesn’t change. So not only must they have battery charger electronics inside, but also converter electronics that deliver a constant voltage. Probably something like a switching-mode power supply circuit, because when I look at the ripple of the voltage with an oscilloscope, I see a pattern that makes me think of a switching-mode power supply:

That’s for a AA battery that delivers power to an electronic load that draws 0,100 A current:

The ripple could also come from the electronic load itself, or some electronic noise source in my lab. So to rule that out, I discharged an alkaline battery and got this:

This is a different pattern and it repeats with a different frequency, to the ripple we saw in the first scope picture must come from the battery.

I also did measurements with a spectrum analyzer:

Here you can see a peak (and its harmonics) around 1,20 MHz.

That too comes from the battery, as these peaks do not appear with an alkaline battery:

In the picture of the electronic load screen, one can see 1493 mWh: that’s for the discharge of an AA battery at 0,100 A until the voltage reaches 0,5 V. 1493 is far less than the 3400 mWh printed in a large font on each battery.

I did a series of tests with my AA (0,100 A discharge current) and AAA (0,025 A discharge current) batteries, and on average I get:

TypeMeasured output (mWh)Advertized outputMeasured input (mWh)RTE
AA15273400211472%
AAA478120075463%

Unfortunately, these batteries deliver far less electrical energy than advertized.

For comparison, I also discharged an fresh alkaline AAA battery and got 1380 mWh out of it.

I created a discharge graph for a USB-C rechargeable AA battery:

During more than 9 hours, the voltage stays around 1,45 V (for a 0,100 A discharge current). Then it abruptly drops to 1,05 V, and then 0 V.

Charging the AA batteries requires 2114 mWh on average, the AAA batteries require 754 mWh. This is also far less than the advertized capacity. This allowed me to calculate the Round Trip Efficiency (RTE) in the table above.

Despite the discrepancy in capacity, these batteries have advantages too:

  • the nominal voltage is 1,5 Volt
  • the voltage curve remains (mostly) flat while discharging
  • their chemistry doesn’t result in battery leaks that corrode your electronics
  • you don’t need a battery charger

Disadvantages:

  • far less capacity than advertized
  • very abrupt voltage drop when fully discharged
  • they can’t negotiate power with a USB charger (you can’t charge them with a USB-C to USB-C cable, you must use a USB-A to USB-C cable like the one included)
  • some electronic noise because of the switching power supply

Quickpost info

Friday 5 December 2025

Quickpost: USB Electric Razor

Filed under: Hardware,Quickpost — Didier Stevens @ 20:26

The USB Power Delivery protocol (USB PD) defines power negotiation.

For example, USB trigger boards negotiate power requirements with a USB power source (like a charger or a powerbank), and can ask for a higher voltage than the standard 5V of a USB source that does not support USB PD.

This also explains why there are (cheap) devices with a USB-C port, that can only be powered with a USB-A to USB-C cable, and not with a USB-C to USB-C cable. These devices are not capable to negotiate their power requirements, they expect 5.0 Volts on the VBUS pins. These devices do not support USB PD.

USB PD made it possible to invent all kinds of gadgets, adapters, …

One adapter I want to talk about in this blog post, allows me to charge my Philips electric razor with a USB-C powerbank.

My Philips electric razor has its own proprietary charger and connector, operating at 15 Volts. When I travel, I need to remember to bring along the charger (it does not fit in the razor’s case).

But now I have this adapter:

On one end, it has a USB-C receptacle:

And on the other end, it has the Philips proprietary razor plug.

The adapter negotiates 15 volts with the USB power source:

I didn’t know such adapters existed, but while experimenting with USB PD, I realized that it makes such adapters possible, and so I started to search and found one on AliExpress.

This allows me to travel without an extra charger, just with a very small adapter (and a USB power source).


Quickpost info

Saturday 29 November 2025

Quickpost: CR1225 vs CR1220

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

I had to replace a button cell, a CR1225, but I only had a CR1220.

So I just used that CR1220 in stead. This works, because a CR1220 and CR1225 differ in mechanical properties (dimension), but not in electrical properties (voltage).

Both cells have a nominal voltage of 3 Volts.

CR1220 means the following:

  • C: Lithium battery
  • R: Round
  • 12: 12mm diameter
  • 20: 2,0mm thickness

The difference between a CR1220 and CR1225 is the thickness: a CR1220 is 0,5mm slimmer than a CR1225. So a CR1220 fits in a CR1225 holder without problem.


Quickpost info

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

Saturday 25 October 2025

Quickpost: PEP 515 – Underscores in Numeric Literals

Filed under: Quickpost — Didier Stevens @ 8:07

While attending a great presentation of Kaitai Struct at Hack.lu 2025, I noticed a binary numeric notation during the demo, that I had never seen before. Something like 0b1000_0001.

I’m familiar with notations in Python like 0b10000001, but not with an underscore thrown in to make the number more readable.

Turns out this exists for almost 10 years in Python (since Python 3.6), and that it is known as PEP 515 – Underscores in Numeric Literals.

And it exists in other programming languages too.


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

Thursday 5 June 2025

Quickpost: emldump Bulk Extraction

Filed under: Quickpost — Didier Stevens @ 0:00

A reader asked about bulk extraction of email attachments with emldump.py

If you want to extract all attachments and write them to disk, you can use the following command:

emldump.py --jsonoutput sample.eml | myjson-filter.py -W hashvir

This command will produce a MyJSON data structure will the content and metadata of all parts (not only attachments, also the different bodies) and save the parts to disk with filenames formatted as the sha256 hash of the content and the extension .vir.

You can then run the desired analysis commands on the files written to disk.

But you can also run a command directly on the items, without writing them to disk. Here is an example of such a command:

emldump.py --jsonoutput sample.eml | myjson-filter.py -r "cmd.exe /c oledump.py"

This command will start a oledump.py command for each part in the multipart document, and provide the content of each part via stdout.


Quickpost info

Wednesday 4 June 2025

Quickpost: Firefox Profiles and Multiple Instances

Filed under: Quickpost — Didier Stevens @ 0:00

It’s something that I’ve been doing for 10+years, but every couple of years I need to configure this again (on a new machine), and then I need to look it up because I forgot the details. Hence this quickpost.

This is how I run Firefox on Windows:

"C:\Program Files\Mozilla Firefox\firefox.exe" -ProfileManager -no-remote

This allow me to run multiple instances (option -no-remote) of Firefox and invoke the profile manager to select the desired profile at startup


Quickpost info

Thursday 29 May 2025

Quickpost: Airplanes & Radiation

Filed under: Quickpost — Didier Stevens @ 7:42

When you’re flying high in a commercial airliner, you’re exposed to more radiation, because cosmic rays travel through less atmosphere before they hit a plane flying at 30000 feet. Compared to an airplane on the ground at sea level.

This is something my cheap Geiger counter can pick up.

This is a reading in the airport:

The real-time measure is 0,15 µSv/h, the average is 0,11 µSv/h.

The total dose (accumulated radiation exposure) is 0,0 µSv, because I just reset the counter (prior to take off).

This is a reading at 30,000 altitude:

The real-time measure is 4,02 µSv/h, the average is 3,33 µSv/h.

And after one hour and 5 minutes, the total dose is 2,18 µSv.

So at least this meter is working. I can’t say how precise it is, but it does pick up radiation.

And here is the measure after landing:

The total dose is 3,63 µSv. This was a flight from Brussels to Rome:

And for the flight back to Brussels, the total dose was 4,15 µSv:

The difference between the first flight and the second flight can be a change in cosmic ray activity, but it can also be that this cheap Geiger meter is not reliable enough.

And I also left this meter switched on while it went through the X-ray baggage scanner at airport security:

The dose was 157 µSv.

Let’s compare this to exposure levels for medical purposes, to put this into perspective.

According to this Wikipedia article, a chest X-ray is equivalent to an effective dose of 0,013 mSv. That’s 13 µSv.

So a dose of 4 µSv measured during the flights between Brussels and Rome, is about 3 times less than a chest X-ray.

While the dose from the X-ray baggage scanner (157 µSv) is equivalent to 12 chest X-rays.

And there is also this information:

Cosmic ray dose rate on commercial flights varies from 1 to 10 μSv/hour, depending on altitude, position and solar sunspot phase.

According to ChatGPT:

Commercial airline pilots are classified as occupational radiation workers due to their exposure to cosmic ionizing radiation at high altitudes. The International Commission on Radiological Protection (ICRP) recommends an annual effective dose limit of 20 millisieverts (mSv), averaged over five years, with no single year exceeding 50 mSv.

In the European Union, regulations mandate that aircrew likely to receive more than 1 mSv per year must have their exposure assessed and monitored. Employers are required to implement measures to ensure that individual doses do not exceed 6 mSv per year.

Actual radiation exposure for pilots varies based on factors such as flight altitude, duration, and routes flown. Long-haul pilots, especially those on polar routes, can receive between 4.5 and 6 mSv annually, while short-haul pilots typically receive around 2 mSv per year.


Quickpost info
Next Page »

Blog at WordPress.com.