Skip to main content
Participant
March 11, 2009
Question

MySQL encrypted password checking

  • March 11, 2009
  • 1 reply
  • 412 views
Hi,

I'm working with an application that has parts written in perl and parts written in ColdFusion, and the data is stored in an MySQL database. Our user admin functions have been written in perl, and passwords are encrypted by MySQL's 'encrypt' function when entered into the database. To do password verification, after retrieving the encrypted password from the database, the perl code calls 'crypt' in the following manner:

[...]
if (crypt($enteredPWD, $encryptedPWD) NE $encryptedPWD) {
[...]
}
[...]

I now need to do the same checking in ColdFusion (i.e. encrypt the entered password and compare that to the encrypted password in the database). I've been working with the 'Decrypt' and 'Encrypt' functions and am unable to get the functionality I need. The perl 'crypt' function is 'DES' based so that's what I've been using as the 'algorithm' in the functions. I've also tried 'CMFC_COMPAT' with no success.

Is what I need to do possible, and if so, what am I missing?

Thanks in advance,

Jim
This topic has been closed for replies.

1 reply

Inspiring
March 11, 2009
jboyle217 wrote:
> I now need to do the same checking in ColdFusion (i.e. encrypt the entered
> password and compare that to the encrypted password in the database). I've
> been working with the 'Decrypt' and 'Encrypt' functions and am unable to get
> the functionality I need. The perl 'crypt' function is 'DES' based so that's
> what I've been using as the 'algorithm' in the functions. I've also tried
> 'CMFC_COMPAT' with no success.
>
> Is what I need to do possible, and if so, what am I missing?

There's a java implementation of the crypt function somewhere on the net
(I don't have the link anymore). You'll need to download the java
source, compile it, place the class file in CF classpath and then use
the java class from CF.

--
Mack