brute-force

Breaking 224-bit Blowfish encryption

£可爱£侵袭症+ 提交于 2019-12-01 05:32:32
问题 I have a bunch of encrypted files that I want to decrypt (duh). I found out they are encrypted with Blowfish using a 224-bit key after some research. I know what the first few bytes of the plaintext looks like (it's kind of a header). Noting that I am not NSA nor do I have ridiculous computing power, is there any chance of me brute forcing the key within a reasonable time (eg: not the life of the universe)? I read somewhere that someone published an attack on the full-blown Blowfish (no pun

Generating the power set of a list

◇◆丶佛笑我妖孽 提交于 2019-11-30 23:32:45
I have to write a brute-force implementation of the knapsack problem. Here's the pseudocode: computeMaxProfit(weight_capacity) max_profit = 0 S = {} // Each element of S is a weight-profit pair. while true if the sum of the weights in S <= weight_capacity if the sum of the profits in S > max_profit update max_profit if S contains all items // Then there is no next subset to generate return max generate the next subset S While the algorithm is fairly easy to implement, I haven't the slightest idea how to generate the power set of S, and to feed the subsets of the power set into each iteration

Brute force script in Python 3.2

狂风中的少年 提交于 2019-11-30 10:04:38
I'm a beginner in writing code and I've started with Python because it seemed the neatest and the easiest to start with (I currently have Python 3.2). Now I've read some online books and so on about coding in python, I've made some small programs and that's it. But then I wanted to make a program that could brute-force a random password like: PassWord = random.randint(0,9999) I made something that could try random passwords: import random PassWord = str(random.randint(0,9999)) Trial = ' ' while Trial != PassWord: Trial = str(random.randint(0,9999)) print(Trial) if Trial == PassWord: print('The

Java all determine elements are same in a list

旧街凉风 提交于 2019-11-30 05:56:54
I am trying to determine to see if all elements in a list are same. such as: (10,10,10,10,10) --> true (10,10,20,30,30) --> false I know hashset might be helpful, but i don't know how to write in java. this is the one I've tried, but didn't work: public static boolean allElementsTheSame(List<String> templist) { boolean flag = true; String first = templist.get(0); for (int i = 1; i< templist.size() && flag; i++) { if(templist.get(i) != first) flag = false; } return true; } Using the Stream API (Java 8+) boolean allEqual = list.stream().distinct().limit(2).count() <= 1 or boolean allEqual = list

PHP brute force password generator

喜你入骨 提交于 2019-11-30 05:31:38
I want to be able to input a number and get a password, built from a string or unique characters. So if I have two characters in the string : $string = "AB"; these are the desired results : -in-|-out- 0 | A 1 | B 2 | AA 3 | AB 4 | BA 5 | BB 6 | AAA 7 | AAB 8 | ABA 9 | ABB 10 | BBB And so on. Here is my current code : for($i = 1; $i < 100; $i++) { echo createString ($i, "AB")."<br/>"; } function createString ($id, $chars) // THE ISSUE <--- { $length = getLength($id, $chars); //echo "LENGTH : ".$length."<br/><br/>"; $string = ""; for($i = 0; $i < $length; $i++) { $a = round(($id - 1)/pow($length

Generate Distinct Combinations PHP [closed]

浪尽此生 提交于 2019-11-29 12:57:13
I need an efficient algorithm to generate distinct combinations(not allowed to repeat). Each combination has 5 distint numbers(different numbers) that ranges between 1 and 99. The result must be stored in an array. If possible I would like the numbers and range allowed to be customized. The order of number doesn't matter(01 02 03 = 03 01 02) Ex.: 01 02 03 04 05 02 03 04 05 06 ... Does anyone could help me to build it? I would like to pick up some random combinations from the array. Nowdays I am generating random combinations using mt_rand but It takes too much time, SO SLOW! I believe happens

Simulated Annealing TSP

六月ゝ 毕业季﹏ 提交于 2019-11-29 11:27:30
I'm looking to implement the simulated annealing algorithm in Java to find an optimal route for the Travelling Salesman Problem , so far I have implemented brute force and am looking to modify that code in order to use simulated annealing. Obviously brute-force and simulated annealing are very different and use very different functions. I understand simulated annealing uses a variable known as the temperature which then cools as the algorithm runs; with the temperature starting high and it gradually cooling throughout. Whilst the temperature is high the algorithm is more likely to choose

PHP brute force password generator

*爱你&永不变心* 提交于 2019-11-29 04:10:44
问题 I want to be able to input a number and get a password, built from a string or unique characters. So if I have two characters in the string : $string = "AB"; these are the desired results : -in-|-out- 0 | A 1 | B 2 | AA 3 | AB 4 | BA 5 | BB 6 | AAA 7 | AAB 8 | ABA 9 | ABB 10 | BBB And so on. Here is my current code : for($i = 1; $i < 100; $i++) { echo createString ($i, "AB")."<br/>"; } function createString ($id, $chars) // THE ISSUE <--- { $length = getLength($id, $chars); //echo "LENGTH : "

Python Brute Force algorithm [closed]

荒凉一梦 提交于 2019-11-28 16:01:27
I need to generate every possible combination from a given charset to a given range. Like, charset=list(map(str,"abcdefghijklmnopqrstuvwxyz")) range=10 And the out put should be, [a,b,c,d..................,zzzzzzzzzy,zzzzzzzzzz] I know I can do this using already in use libraries.But I need to know how they really works.If anyone can give me a commented code of this kind of algorithm in Python or any programming language readable,I would be very grateful. If you REALLY want to brute force it, try this, but it will take you a ridiculous amount of time: your_list = 'abcdefghijklmnopqrstuvwxyz'

Generate Distinct Combinations PHP [closed]

青春壹個敷衍的年華 提交于 2019-11-28 06:24:22
问题 I need an efficient algorithm to generate distinct combinations(not allowed to repeat). Each combination has 5 distint numbers(different numbers) that ranges between 1 and 99. The result must be stored in an array. If possible I would like the numbers and range allowed to be customized. The order of number doesn't matter(01 02 03 = 03 01 02) Ex.: 01 02 03 04 05 02 03 04 05 06 ... Does anyone could help me to build it? I would like to pick up some random combinations from the array. Nowdays I