wa4e | Course materials for www.wa4e.com | Learning library
kandi X-RAY | wa4e Summary
kandi X-RAY | wa4e Summary
Course materials for www.wa4e.com.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Factory method to create a new Request object .
- Parses lines .
- Expand a match expression .
- Parse a selector .
- Starts the process .
- Create a cookie from a string .
- Perform the request .
- Parse a cookie .
- Convert glob glob to a regular expression
- Creates a redirect request
wa4e Key Features
wa4e Examples and Code Snippets
Community Discussions
Trending Discussions on wa4e
QUESTION
I had an assignment to make a md5 crack of a four character string using brute-force algorithm. The program takes md5 hash as input and outputs the four digit string corresponding to the hash (can be calculated from here).
Below is my PHP source code. (Built on top of already provided sample)
...ANSWER
Answered 2018-Dec-11 at 19:05Your debugging code only prints when the hash doesn't match. Since you entered the hash for 0000
, it finds the match on the first attempt, and doesn't print that.
The break
statement by default only breaks out of the closest loop. So when you find a match, you break out of the loop that's incrementing the last digit, but continues the other loops. So when it matches 0000
, it goes to the next iteration of the $k
loop, and tries next with 0010
.
You should break out of all the loops when you find the match. You can use break 4
to break out of 4 levels of loop, but a better way would be to move the loops into a function and use return $try;
to return the value that was found. Returning from a function terminates all the loops.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install wa4e
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page