It's one of besk keept "secrets" of Joomla 2.5+ - there is a built in password strenght meter, ready to be used. And some are selling for good money - and others offering free plugins - to let you unleash the hidden power.
But if you aren't afraid to make your hands dirty with some PHP code, here is how you can do this: