Decoding a compressed short string; undefined in compression - Updated

I have a program that compresses a string in an unknown way. I know several inputs and the result, but I'm not sure what is used to compress the string.

Here are my examples.

(38 xa total, spaces or something else)

In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" Out: "21 1A A6 30 00" 

(total 32 xa)

 In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" Out: "1c 1a a7 a0 00" 

(31 xa, then 1 b)

 In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" Out: "01 77 c5 53 c0 00" 

(31 xb, then 1 a)

 In: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbba" Out: "1e 77 54 f3 80 00" In: "Hey wot u doing 2day u wanna do something" Out: "11 C7 C6 2E 78 CE 6B 8E 3A CD 83 E8 1B 37 C5 C5 A6 B9 D1 E1 B0 69 63 DB 5E 71 15 5C 10 00" 

(similar to the previous line, but with a space at the end)

 In: "Hey wot u doing 2day u wanna do something " Out: "12 C7 71 8B 9E 33 9A E2 EB 36 0F A0 2C DF 17 17 7A 67 47 86 DF 4B 1E DA F3 88 AA E0 80 00" 

Any help / advice would be great, thanks! In addition, it can help find out what is from the BlackBerry 8120.

+4
source share
1 answer

Its unlikely that anyone can figure out which compression algorithm is used just by looking at the provided strings.

Assuming they are also not encrypted (but simply converted using an algorithm without entering a key or other type of secrecy), the only approach I can think of is brute force. That is, write some code to convert the input values ​​using various compression algorithms and observe the generated outputs. This is not like the LZW algorithm used by the .NET classes DeflateStream and GZipStream, so you can skip at least one;)

My recommendation is to look at the BlackBerry SDK and find out what algorithms it supports, since it will probably be one of them.

You may also find this lesson of interest: Compressing Compression Data

+1
source

Source: https://habr.com/ru/post/1302041/


All Articles