Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bruteforcing
04-01-2010, 12:24 AM
Post: #1
Bruteforcing
I think all know what is it, in case you dont, you can check wiki.


And here is simple algorithm from book of algorithms in pascal :


Code:
function search( pat: PATTERN; text: TEXT ): integer; var i, j, m, n: integer;
begin
search := 0;
m := length(pat);
if m=0 then begin search := 1;
goto 999;
end; n := length(text); j := 1; i := 1;
while (i<=n) do
begin
if text[i] <> pat[j] then
begin
i := i - j + 1; j := 1;
end
else
begin
j := j + 1;
if j > m then
begin
search := i - j + 2;
goto 999;
end
end;
i := i + 1;
end
999:
end;


More about it, after i get back from doctor, I have pretty bad pneumonia Confused Sad

Read rules Smile
[Image: legislator.png]
Find all posts by this user
Quote this message in a reply
04-01-2010, 03:01 AM
Post: #2
RE: Bruteforcing
Very good i can see that you avoided using "begin/end" statements and you used "goto".
Basically it can be made faster.
Just treat it as a sub-string search. Look if length of sub-string matches the string and if first letter match than go to end check of all.
I think that is clear enough.
But overall THX for sharing !

There's a fine line between genius and insanity. I have erased this line.
Oscar Levant
There's a fine line between an administrator and black hat hacker. I have erased this line.
Dr DEBCOL
Visit this user's website Find all posts by this user
Quote this message in a reply
04-01-2010, 05:01 AM
Post: #3
RE: Bruteforcing
Basicly, bruteforcing, searching a string, char by char, and asking if char is on right place... Bruteforcing in computing became of same named process in math (as the most things in programing)... The most common use is for braking cryptographic values (passwords, DB hashes...) but math formula of bruteforcing is a wider used in the real life for solving practical problems.

Read rules Smile
[Image: legislator.png]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: