python写的软件怎么逆向,用于逆向工程的Python

A friend of mine wrote an algorithm that generates strings. He says that

it''s impossible to figure out exactly how the algorithm works. That may

be true, but I think if I had enough sample strings that I could write a

program to identify patterns in the strings and then produce strings

with similar patterns. He disagrees with me. He gave me 100 strings to

analyze.

I wrote a script to read each string and build a list of characters

present. I''ve discovered that he only uses 20 alpha/numeric chars to

generate the strings and that each string sums up to a value between

1000 and 1200 when I assign each char in the string its ASCII value.

What else might I do to analyze these things? As it stands now, I can

generate an acceptable string on ever 100th attempt or so, but I''d like

to do better than this.

-b

解决方案

Brad Tilley writes:

A friend of mine wrote an algorithm that generates strings. He says

that it''s impossible to figure out exactly how the algorithm

works. That may be true, but I think if I had enough sample strings

that I could write a program to identify patterns in the strings and

then produce strings with similar patterns. He disagrees with me. He

gave me 100 strings to analyze.

I wrote a script to read each string and build a list of characters

present. I''ve discovered that he only uses 20 alpha/numeric chars to

generate the strings and that each string sums up to a value between

1000 and 1200 when I assign each char in the string its ASCII value.

What else might I do to analyze these things? As it stands now, I can

generate an acceptable string on ever 100th attempt or so, but I''d

like to do better than this.

Build a markov chain generator. Basically, build tuples of characters

of length N, and use those to index a dictionary containing a list (or

string) of characters that follow that list of characters in your

input strings. So, with N equal 2, and d[(''a'', ''b'')] = [''c'', ''d'', ''e'']

you''d know that the strings abc, abd and abe appeared in the text. To

gennerate a string, pull a random key from the dictionary, then choose

random characters from the list that the last N characters treated as

a tuple index in the dictionary. Larger values of N generate strings

that more closely resemble the input text.

Optionally, make the objects stored in the dictionary keep a count of

how many times each character appears, and choose one randomly

weighted by those counts.

I''ve got a markov chain generator that works on words if you really

want to see one.

--

Mike Meyer http://www.mired.org/home/mwm/

Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

Brad Tilley writes:

A friend of mine wrote an algorithm that generates strings. He says that

it''s impossible to figure out exactly how the algorithm works. That may

be true, but I think if I had enough sample strings that I could write a

program to identify patterns in the strings and then produce strings

with similar patterns. He disagrees with me. He gave me 100 strings to

analyze.

What input, if any, does the algorithm take? What are the strings

used for? Care to post the 100 strings so others can have a look?

What else might I do to analyze these things? As it stands now, I can

generate an acceptable string on ever 100th attempt or so, but I''d like

to do better than this.

Reading about cryptanalysis might prove fruitful. I suspect the

number of "impossible to figure out" algorithms is far less than

the number of algorithms whose developers initially made that claim.

--

Michael Fuhr

http://www.fuhr.org/~mfuhr/

Michael Fuhr wrote:Brad Tilley writes:

A friend of mine wrote an algorithm that generates strings. He says that

it''s impossible to figure out exactly how the algorithm works. That may

be true, but I think if I had enough sample strings that I could write a

program to identify patterns in the strings and then produce strings

with similar patterns. He disagrees with me. He gave me 100 strings to

analyze.

What input, if any, does the algorithm take?

I don''t know, but I''m guessing that there is none.

What are the strings used for?

To unlock an application he wrote (software key).

Care to post the 100 strings so others can have a look?

I''d rather not do that.

Reading about cryptanalysis might prove fruitful. I suspect the

number of "impossible to figure out" algorithms is far less than

the number of algorithms whose developers initially made that claim.

I suspect you''re right.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值