Why is the cars CAN bus insecure?

and how did we end up in this situation?

There is a couple of wires inside your car which control many car components, from lights and signal to trunk, ABS and even brakes. This couple of wires is called “CAN bus”, CAN meaning Controller Area Network. Access to this bus by hackers gives them significant control of the car, and as has been shown in recently published car hacks, this is possible, and has been done.

At the source of the hack is the fact that CAN bus has no security, and anyone with the ability to intercept and inject messages can take over the car. Therefore right after reading about those hacks, many people who are familiar with security but not with car manufacturing process, often ask this question: why does the CAN bus is so insecure?

In this article I will try to explain, why CAN bus evolved this way, and what are security challenges to secure it.
Continue reading »

car security , , Leave a comment

Usability of Qt5 QMediaPlayer for multimedia applications

I have developed several multimedia applications using Qt4 and Qt5. In past, when creating Karaoke Lyrics Editor with Qt4, I initially used Phonon, which was offered by Qt4 multimedia framework. Unfortunately I quickly found the issues with this framework, making it less useful for my purpose:
Continue reading »

Linux, qt Leave a comment

Reverse-engineering Lyric file format – handling encryption with a known plaintext attack

This article explains how to reverse-engineer file formats by using what is called a known plaintext attack. This is a kind of attack when an attacker has an ability to pass the plaintext to the oracle (in our case the enryption algorithm) and receive back the encrypted text, and do it as many times as needed.

Yesterday I was working on adding support for reading Encore! Lyric files in the Karaoke player. I do not have this player anymore (I had purchased the lifetime license from Igor Marinin, but its author revoked it after I reached out to him asking whether the music he bundled with the player is properly licensed, as it appeared to be pirated – do not deal with this guy). However my friend sent me a few files to look at, which appear encrypted. So I asked him to create a file with a single lyric line of 96 ‘@’ characters.

The ‘@’ was chosen because its binary representation of 01000000 makes it the easiest to detect the XOR-based encryption patterns, while it is a printable ASCII character which is easy to type and has a known encoding. Also the string contains the same characters so if it is XORed agains a fixed size key, we would see the repeated pattern. I have asked him also to create another lyric with multiple lines of ‘A’ characters, to test my theories.
Continue reading »

reverse engineering Leave a comment

Reverse-engineering the EMZ karaoke format, or watch out the API calls

Worked on adding support for the EMZ karaoke format to the Karaoke Player application, and would like to share another good reverse-engineering technique.

EMZ is a Karaoke format similar to the old Karafun, based on a password-protected ZIP archive. Unlike Karafun, the password is not embedded into the archive, but is derived from a some kind of “login”. The editor is able to create the password-protected files, and can open them without Internet connection, so the password derivative algorithm is built into the software, and is not stored on the remote server. This is a classic example of “security through obscurity”, and, as usual it does not work well.

Normally finding out the algorithm would require reverse-engineering the Editor binary. It is written in Deplhi, so this would be less than a pleasant way to spend the weekend. But due to Delphi’s heavy usage of Win32 API, this is not needed at all! Leave your IDA and Ollydbg on a shelf, and see how easy this could be done.

Continue reading »

reverse engineering, Uncategorized 2 Comments

Generating C or Java byte array from a binary using command-line tools

Once in a while during development a software engineer needs to embed the binary object as byte array in C or Java language. While coding a solution is simple, it could be achieved by the following command line on Linux or cygwin:

For unsigned data:

od -v -t u1 <binary file> | cut -c9- | sed 's/\([0-9]\+\)/\1,/g'

For signed data (Java byte arrays):

od -v -t d1 <binary file> | cut -c9- | sed 's/\([0-9]\+\)/\1,/g'
Uncategorized Leave a comment

Mac OS X guest and VirtualBox 5 on AMD CPU

Before you proceed: there is NO working solution yet, and I was not able to run unmodified Mac OS X guest on AMD CPU under VirtualBox. It runs fine under KVM however.

Installing it on a machine with Intel CPU is not a problem. While VirtualBox does not officially support OS X guests on non-Mac hardware, it is still trivial to do so, as described in the following post.

However this will not be enough on AMD CPU, where the OS X kernel will halt (Mavericks) or crash (Yosemite) on boot. More changes are needed.

Continue reading »

Linux, virtualbox Leave a comment

XPS13 wireless: the ultimate fix

As frequently complained, Dell XPS13 which is otherwise a very nice ultrabook unfortunately offers horrible wireless experience while running Linux. Typical wireless issues include:

  • Not connecting to certain access points (some WPA2-PSK) at all, or taking long time to establish the connection;
  • Dropping the wireless connection frequently and keeping reconnecting;
  • Having bad wireless throughput;

Those issues are traced to the Intel N6230 WiFi card used by XPS13. Intel wireless cards are unfortunately supported rather poorly on Linux. Therefore the best way to address this issue is to replace this card. I had great experience with Atheros cards under Linux – they have a native driver developed in Linux kernel which is the most mature, and feature-rich. Because of this I purchased Atheros AR5B95 AR9285 Half Mini PCI-E card for $7.99. Other cards should work too, just make sure they are Half Mini PCI-E form factor.

Once you receive your card, the replacement is straightforward. See below how to disassemble XPS13 and replace the wireless card.
Continue reading »

Hardware Leave a comment

Breaking the one-time pad encryption

Following up the second week task for the excellent Cryptography course by Prof. Jonathan Katz at Coursera, and took the second programming assignment. This time it is about breaking the one-time pad encryption when the code was reused, and more than one ciphertext is intercepted. Again, the suggested approach required too much manual work, and I decided to extend the previous solution and see whether it would work here as well.

The analysis of previous solution applies here mostly, but with two major differences:
Continue reading »

reverse engineering Leave a comment

Breaking the Vigenere cipher

I have signed up for the excellent Cryptography course by Prof. Jonathan Katz at Coursera, and took the first programming assignment which was about breaking the Vigenere cipher. The instructor explained one of the ways to do it, and recommended to rely on letter distribution in English. But while the suggested approach was interesting, I decided to try something different and see if it is possible to break the cipher without using the statistic distribution.
Continue reading »

reverse engineering 10 Comments

Android: an easy splash screen implementation using ImageView

I’ve seen a number of suggestions of how to implement a splash screen properly. Most typical implementation is through activities. To show it, you need to make it the first activity in your application, which has a few disadvantages:

  • It is an activity, so it will use the Android-specific effect (typically sliding) to switch from splash screen to main menu, giving you little to no control over how you want your splash screen to disappear;
  • If you have an option to disable splash screen, the first activity would still show (since it is in manifest), and you’d have to close it and switch to main activity, which will have undesirable UI effects.

A much better way is to implement it as a view inside the same main activity. This would avoid both issues above.
Continue reading »

android Leave a comment