For example, how could I measure the normal power consumption of my USB keyboard?
After I get my statistics, I may easily notice when a hardware keylogger gets installed, by the changed power consumption.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityFor example, how could I measure the normal power consumption of my USB keyboard?
After I get my statistics, I may easily notice when a hardware keylogger gets installed, by the changed power consumption.
USB current/voltage meters exist. Here's one on Amazon (though unfortunately out of stock at the moment). Here's the same model on eBay (from Germany, but ships worldwide).
Alternatively, if you're up for a bit of DIY, see this project on Instructables. You'll need a multimeter, though, because that's just a passive passthrough connector that simply provides a couple of test points.
You didn't specify, but I know Windows (and probably other modern OS's) will tell you how much power is "required" for each attached USB device in the properties of each "USB Root Hub" in the Device Manager.
Regardless of that, unless you're talking about a physical hardware keylogger that has to be in-line with the keyboard, then you're not going to be able to detect it by electrical draw in the way you are suggesting (by watching the keyboard).
Just as an additional option: USBDeview utility from NirSoft.
Although it also shows negotiable power consumption that device tells to the USB bus, it is fairly useful for those who have USB3.0 controller, as it lacks correspondent applet in Windows Device Manager.
I would recommend this USB power meter...
http://www.smartronixstore.com/index.cfm?fuseaction=product.display&product_ID=53
I use it and it works great. Better than hacking up cables and trying to tie in a multimeter.
There seems to be one at AdaFruit, called USB Charger Doctor. It looks simple, but efficient.
"International orders are shipped using USPS which is the US Postal Service."
In recent lights, this may (unfortunately) also be relevant: NSA reportedly installing spyware on US-made hardware
Just to add Mac info to the overall solution…
You can see data for each hub & device from
menu > About this Mac > System Report > USB...
I haven't tried it but you could get a regular Mains Power Meter plug and unplug the keyboard and measure the difference.
What I have tried, is you could also connect a multimeter in series and measure the current. Like break the usb cable and connect your multimeter in between. If somebody can describe that process fully then that'd be great and a better answer than mine.
Given the Voltage(5V) and current/amps, you can measure the Power/watts.
Power(P) = Current(I) * Voltage(V)
P=I*V
added- now tried indrek's solution.. PC USB 2.0 Cable Device Voltage Current Meter Tester