Ryan wrote:
> At 07:11 PM 8/21/2002 +0100, you wrote:
> 
>>I wrote one ages ago, but I've not got the code anymore. You can grab the C
>>code from the php / perl / linux sources.. or otherwise use cfexecute & bash
>>shell to return the encrypted password
>>
>>Justin
> 
> 
> I think the CF Hash() function might work?  I think it's the same 
> encryption method.
> 
> Or you could shell out and call the htpasswd executeable that comes with 
> apache.
> 
> -Ryan

I don't think any coldfusion function does it. If anybody finds a 
solution in pure ColdFusion, send it in!
I don't know much about bash shell and how to reach it with cfexecute, 
but i found this workaround:

 From mySQL information:

ENCRYPT(str[,salt])
Encrypt str using the Unix crypt() system call. The salt argument should
be a string with two characters. (As of MySQL Version 3.22.16, salt may 
be longer than two characters.):
mysql> select ENCRYPT("hello");
-> 'VxuFAJXVARROc'
If crypt() is not available on your system, ENCRYPT() always returns NULL.
ENCRYPT() ignores all but the .rst 8 characters of str, at least on some 
systems.
This will be determined by the behavior of the underlying crypt() system 
call.

My passwordcreationthingy:

<cfquery datasource="" name="encrypt">
SELECT ENCRYPT('password','pa') AS Pass
</cfquery>
<cfoutput query="encrypt">#Pass#</cfoutput>

My question: performance? Not that this will be used very frequently, i 
would like to know witch solution is the most performant, using your 
cfexecute & shell thingy or database access?

Peter

______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-linux%40houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_linux or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to