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

.htpasswd generator

Explorer ,
Sep 28, 2006 Sep 28, 2006
Hello All,

I was woundering if any one could point me in the correct direction, how would you go about encrypting passwords using coldfusion to work in the .htaccess .htpasswd format used commonly with apachie web servers.

I have the script for it on my PHP server but am woundering how to do it with a cold fussion page
PHP script below

<?php
// Password to be encrypted for a .htpasswd file
$clearTextPassword = 'passwordhere';

// Encrypt password
$password = crypt($clearTextPassword, base64_encode($clearTextPassword));

// Print encrypted password
echo $password;
?>

I understand whats going on here just am not sure how to do the same thing in coldfussion, sorry my coldfussion knoledge is patchy.

Kind Regards Guy

TOPICS
Advanced techniques
567
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
Guest
Sep 28, 2006 Sep 28, 2006
The hash () function provides superior security.

Question: Do you need to interoperate with a php system or generate hashes that are identical to the php code posted?
That could get tricky because crypt uses unix DES for the default hash.
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
Explorer ,
Oct 02, 2006 Oct 02, 2006
LATEST
not sure about replicating it, but it you're using a linux server you can always rely in the htpasswd binary. See attached code.
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