Dec 20

Google CodeSearch is an awesome tool that has the ability to explain how functions work, how other programmers handled difficult problems.. Or just provide you material to laugh at. Codeulate has a great list of comment swearing. I gotta say, I'm guilty of this too, but at least my anger isn't usually revealed to the world!

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit
Dec 19

A while back when I was first learning AJAX, I decided I wanted to write an interactive PHP/JavaScript shell for executing commands, etc. All the other ones I found either didn't handle directories well, were way too bulky or were backdoored. So, I now present to you JAXED Shell. I haven't extensively tested it, but it should work in the majority of situations.

Enjoy :)
Commands:

home - return to shell's home directory
clear - clear history box
up/down arrow - go through previous commands
right arrow - file name completion

Read the rest of this entry »

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit
Dec 17

Wrote this for one of my projects - hopefully it helps you out a little bit. POST data needs to be formatted variable1=value&variable2=value2 and urlencoded.

function CURL($url, $postdat=""){
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HEADER, 0);
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
	if($postdat){
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $postdat);
	}
	while(!$dat) $dat = curl_exec($ch);
	curl_close($ch);
	return $dat;
}

Examples:

$dat = CURL("http://google.com");
$dat = CURL("http://site.com/post.php", "search=bunnies");

Sorry I haven't had much content lately: finals this week :-\

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit
Dec 8

A few months ago I read this excellent article on password hashing schemes and I found some things out that I hadn't previously thought about. For instance, this sounds like a pretty novel thing, but speed in a hashing algorithm is not what you're looking for, and some hashing algorithms are much slower than others by design. Well, the other day someone on IRC didn't believe that crypt() would take a significant time more than md5(). Well, of course, I had to test it. So here's what I came up with to benchmark the two:

$t = microtime(true);
for($i=0;$i<5000;$i++){
	$m = md5('password');
}
$diff = microtime(true) - $t;

$t2 = microtime(true);
for($i=0;$i<5000;$i++){
	$m = crypt('password');
}
$diff2 = microtime(true) - $t2;
echo("MD5: " . $diff . "\\n");
echo("crypt (DES): " . $diff2 . "\\n");
echo("MD5 was " . $diff2/$diff . " times faster than crypt");

My average results with this say that md5() is something close to 125 times faster than crypt(). If you were just hashing one password, the difference would be negligible to the user. However, if someone is trying to brute one versus the other, the time will definitely make a difference. The moral of the story? Sometimes slower is better.

I apologize to any cryptographers who were hurt while reading this post; it's not very scientific, but it is the simplest way I can think of to demonstrate the time difference between these two algorithms. I'm sure you could do it better, and I encourage anyone who knows more than I do to let me know in the comments.

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit
Nov 27

Well, today my Windows Utilities post got Stumbled (God knows why, there's only about a hundred of these out there). My traffic shot through the roof. This was my first time being Stumbled, so needless to say, I was a little bit excited.

Thank you, StumbleUpon. :)

  • Digg
  • StumbleUpon
  • del.icio.us
  • Reddit

« Previous Entries Next Entries »