Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MySQL encrypted password checking

New Here ,
Mar 11, 2009 Mar 11, 2009
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
TOPICS
Advanced techniques
390
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 11, 2009 Mar 11, 2009
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources