So a TNS file entry compressed with the unknown “D” method is:

  1. XML-compressed by the OS with a custom binary XML method
  2. deflated with zlib
  3. Encrypted

I was curious about 1) and 3).

I first checked that XML-compressing a Lua script from a skeleton (similarly to what the current third-party Lua converters for OS 3.0.1 do) is quite easy without needing to implemented the patented algorithm, thus avoiding any legal issues. This is good news.

I also had a closer look at the encryption algorithm. It is actually an OpenSSL-based Triple-DES encryption in ECB mode (thanks Google Code Search for making ARM code so much clearer). The 3 keys are probably embedded in the OS although I didn’t bother to look where exactly. Computer-side encryption tests confirm that the 3 keys I found are the good ones.

Integrating this into to a new Lua converter compatible with OS 3.0.2  should now be easy :)