tag:blogger.com,1999:blog-8457215987489699717.post354239920448645002..comments2017-10-10T04:57:54.420-07:00Comments on quangntenemy teaches Java: BF it!quangntenemyhttp://www.blogger.com/profile/06889040235572873334noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-8457215987489699717.post-68795176114145489572010-05-07T09:19:07.533-07:002010-05-07T09:19:07.533-07:00Oops looks like it's been a long time.
I agre...Oops looks like it's been a long time.<br /><br />I agree that the code is ugly but keep in mind the <a href="http://en.wikipedia.org/wiki/KISS_principle" rel="nofollow">KISS principle</a>.<br /><br />Using multiple nested for loops is the most straightforward way to go about bruteforcing. It takes almost no time to code, and provides the best performance. When you're cracking a password, reducing coding time and execution time is an important factor.<br /><br />Finally, when the need for another for loop arises, it's not the time to worry about coding style or software design. Since the complexity increases exponentially, you'll have to consider whether it's time to continue bruteforcing, or switching to another cracking method ;)quangntenemyhttps://www.blogger.com/profile/06889040235572873334noreply@blogger.comtag:blogger.com,1999:blog-8457215987489699717.post-3803694434625357352009-09-25T08:28:02.784-07:002009-09-25T08:28:02.784-07:00quangntenemy, with all due respect to your intelle...quangntenemy, with all due respect to your intellect I gotta say: the method used for bruteforcing is garbage from a professional software-developers point of few. Do you want to add yet another loop, or even worse, yet another function/method, for each character added to the password?<br /><br />Recursion is the answer to this ugly piece of code and I doubt it'd have a performance-impact you'd experience on today's machines.<br /><br />I also think that it'd be better to teach good software design than to recite api docs, like you did in an other post.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8457215987489699717.post-30429793999736153222008-10-19T18:20:00.000-07:002008-10-19T18:20:00.000-07:00Oops that's a bug in my example. It should have be...Oops that's a bug in my example. It should have been 1. Fixing it. Thanks!quangntenemyhttps://www.blogger.com/profile/06889040235572873334noreply@blogger.comtag:blogger.com,1999:blog-8457215987489699717.post-60370363057969159782008-10-13T11:52:00.000-07:002008-10-13T11:52:00.000-07:00Hi.In the check() method, n was intialized to 0, s...Hi.<BR/><BR/>In the check() method, n was intialized to 0, so no matter what you multiply it with, it's value is 0 after the loop is executed.<BR/><BR/>I mean i dont understand what the point of multiplying n with characters in the string is.<BR/><BR/>Why dont we just write it like this? It's the same thing.<BR/><BR/>public static boolean check(String s)<BR/>{<BR/> if(s.length() != 4)<BR/> return false;<BR/> int n = 0 ^ s.hashCode();<BR/> return n == 0x30f4bc;<BR/>}<BR/><BR/>Thank you very much :)Phuc Nguyenhttps://www.blogger.com/profile/11449843559262917226noreply@blogger.comtag:blogger.com,1999:blog-8457215987489699717.post-41072149024354973842008-07-14T00:03:00.000-07:002008-07-14T00:03:00.000-07:00Read on to my post about dictionary attack. That's...Read on to my post about dictionary attack. That's the second method for password cracking.quangntenemyhttps://www.blogger.com/profile/06889040235572873334noreply@blogger.comtag:blogger.com,1999:blog-8457215987489699717.post-81686614631922015822008-06-27T06:15:00.000-07:002008-06-27T06:15:00.000-07:00Hi Quang, I successfully used your password cracki...Hi Quang, I successfully used your password cracking method in some challenges ;-). But I don't find a efficient way to do it if we don't know the lenght of the password we have to crack. What is the best method to use ? Thanks for your help.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8457215987489699717.post-20189570563439076392007-11-26T11:32:00.000-08:002007-11-26T11:32:00.000-08:00Great to have the java tutorial, finally!Looking f...Great to have the java tutorial, finally!<BR/>Looking forward to the next ones :)ozehkahttps://www.blogger.com/profile/00201960128530860084noreply@blogger.com