解码压缩的短字符串;不确定使用的压缩 - 已更新
我有一个程序正在以未知的方式压缩字符串。我知道一些输入和产生的输出,但我不确定使用什么来压缩字符串。
这是我的例子。
(只有 38 xa,没有空格或其他任何内容)
In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Out: "21 1A A6 30 00"
(只有 32 xa)
In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Out: "1c 1a a7 a0 00"
(31 xa,然后 1 b)
In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
Out: "01 77 c5 53 c0 00"
(31 xb,然后 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"
(与之前的字符串相同,但末尾有一个空格)
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"
任何帮助/建议那就太好了,谢谢! 此外,了解这些来自 BlackBerry 8120 可能会有所帮助
I have a program that is compressing a string in an unknown way. I know a few inputs and the output produced, but I am not sure what is being used to compress the string.
Here are my examples.
(just 38 x a, no spaces or anything else)
In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Out: "21 1A A6 30 00"
(just 32 x a)
In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
Out: "1c 1a a7 a0 00"
(31 x a, then 1 b)
In: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
Out: "01 77 c5 53 c0 00"
(31 x b, 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"
(same as previous string, 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!
Also, it may help to know these are from a BlackBerry 8120
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅通过查看提供的字符串,人们不太可能找出正在使用哪种压缩算法。
假设它们也没有加密(只是使用算法进行转换,而不输入密钥或其他类型的秘密),我能想到的唯一方法就是暴力破解。也就是说,编写一些代码来使用不同的压缩算法转换输入值并观察生成的输出。它似乎不是 .NET DeflateStream 和 GZipStream 类使用的 LZW 算法,因此您可以至少跳过一个;)
我的建议是查看 BlackBerry SDK 并找出它支持哪些算法,因为它很可能成为其中之一。
您可能还会对本教程感兴趣:黑客数据压缩
Its unlikely that someone can figure out what kind of compression algorithm is being used just by looking at the supplied strings.
Assuming that they're not encrypted also (but merely transformed using an algorithm without the input of a key or other kind of secret), the only approach I can think of is brute force. That is, write some code to transform the input values using different compression algorithms and observe the outputs generated. It does not seem to be the LZW algorithm used by the .NET DeflateStream and GZipStream classes, so you can skip at least one ;)
My recommendation would be to look at the BlackBerry SDK and find out what algorithms it supports, as it's likely to be one of those.
You may also find this tutorial to be of interest: Hacking Data Compression