Your USB charged devices can be attacked through the USB port while charging. This has been demonstrated at Blackhat 2013 (https://www.blackhat.com/us-13/briefings.html#Lau,http://www.extremetech.com/extreme/157207-black-hat-hackers-break-into-any-iphone-in-under-a-minute-using-a-malicious-charger) and documented on the web under the general term "Juice Jacking". See for example: http://www.zdziarski.com/blog/?p=2345.
How can we protect ourselves against malicious public charging stations or cheap iphone chargers sold on chinese websites? One of the answers is to make a USB cable which can only feed power to the USB device without any ability to transfer data. This is suprisingly easy to do so let's get starting!
Step 1: Shopping list and tools
We will need:
Tools & skills:
Step 2: The incision
We need to make a short incision along the length of the USB cable using the paper cutter. It can be a bit tricky as you need to be careful not to cut the USB wires and at the same time cut through the whole insulation which can be thick.
One way I found that works is to first make a shallow cut and make it gradually deeper until you can feel the knife moving smoothly when it's tip gets to the empty space between the insulation and the wires. In case you are not sure you can do this properly take some old keyboard or mouse cable and practice.
Also, it's good to buy two USB cables so that you won't have to wait for a new one when you make a mistake. They are dirt cheap so it's a good idea to have a backup.
Step 3: Open and inspect
Open and inspect the cut to see if the USB wires that we care about are not damaged. We have to leave the red and black wires as they provide the power. The other wires (white and purple) are the data lines.
Step 4: Cut the data wires
Simply cut the data wires leaving the power wires intact.
Step 5: Finish up
Seal the incision with a bit of duct tape.
Step 6: Test
Connect the device to your PC using the cable you've made. If the device starts to charge but the operating system doesn't see the new device plugged in your cable works! How to check if your operating system detects the device or not?