[IRCServices] Perl Script for Encrypting Passwords..

Trevor Talbot quension at mac.com
Sat Mar 27 14:17:40 PST 2004


-----
From: achurch at achurch.org (Andrew Church)
Date: Wed Sep 17, 2003  07:27:17 US/Pacific
To: ircservices at ircservices.za.net
Subject: Re: [IRCServices] Database encryption

      This isn't possible at the moment.  I'm hoping to make it possible 
for 5.1.  In the meantime, you can export to XML and encrypt the 
passwords manually.  Something like the following Perl snippet 
(pseudocode) should do it:

	undef $/;
	$data = <XML>;
	s,<pass>([\0-\377]*?)</pass>,"<pass>".&escape(&md5($1))."</pass>",eg;
	print NEWXML $data;

where &md5 is a subroutine that returns the MD5 hash of its parameter 
(raw binary, not hex string), and &escape turns non-ASCII characters 
into &#nnn; entities.

   --Andrew Church
     achurch at achurch.org
     http://achurch.org/

> Hello all,
> I have a simple question that I can't seem to find the answer to. How 
> can I convert the my services database to use MD5? Just enabling 
> encryption/md 5 breaks it. :/
> Jeian/John
-----