Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Reverse Engineering a Board Game

A board game called "Hitster" was recently received as a gift, which involves identifying songs and guessing information such as release year and artist. Each card contains a QR code that, when scanned using the Hitster app, plays the song through Spotify or Apple Music. However, the app requires a subscription to either platform.

To better understand the game, the author reverse engineered the Android app and bypassed the app's encryption methods. The game operates by scanning a QR code on each card, which takes the user to a URL with the game's region (DE in this case) and a card ID. The music begins playing in the app or through Spotify based on the mapping from Card ID to Spotify Track.

The author obtained the APK from a sketchy website and used jadx to decompile the Java code. The decompiled code revealed JSON files, one of which was encrypted in Base64. After decoding it, the data appeared to be encrypted with AES, a symmetric encryption algorithm. The decryption process involves three functions, with the second function (m) taking the AES key and nonce as inputs.

The AES key is derived from the secret string through SHA-256 hashing. The author searched for a byte array of 32 bytes, which led to the discovery of two arrays in the code. By XORing the two arrays, the secret string was uncovered, which was then used to write a decryptor in Rust. This decryptor provided a comprehensive mapping of card IDs to Apple Music and Spotify tracks, along with ISRCs, across different regions.

Despite spending around 18 hours on this project, the author eventually found the "secret" information directly on the Hitster website without needing to uncover the encryption methods.

Rewritten by urgent.news; may contain errors — check the original.

Source: wuemeli.com

Read the original at wuemeli.com →

Report a problem with this story

More in Tech

More from Monday 23 November →