Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Wich encrypting method ?

    pfSense Packages
    3
    4
    576
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      grinderfurax last edited by

      Hello.
      Because Squid is unable to use my Active Directory for authentification (my tree is too complex and the search is unable to find the users), I' think the more simple is to use a local base of users.

      Pfsense purposes a page to create user per user but I have 1300+ users to create each year. I'd like to write a tool to convert my clear users list into an encrypted one, like pfsense do.

      After a lot of search, I could find the file where usernames and passwords are saved : /var/etc/squid.passwd

      Inside squid.inc php code I could find this : $contents .= $user['username'] . ':' . crypt($user['password'], base64_encode($user['password'])) . "\n";

      My ask is wich encryption method is used behind the "crypt" function ?

      Thanks a lot.

      1 Reply Last reply Reply Quote 0
      • BBcan177
        BBcan177 Moderator last edited by

        From this line in the code -

        base64_encode($user['password'])) . "\n";

        Seems to be base64 encoded

        http://www.php.net//manual/en/function.base64-encode.php

        1 Reply Last reply Reply Quote 0
        • G
          grinderfurax last edited by

          Thanks a lot.

          I made custom php page to encrypt a file of users. Didn't tried it with a lot of users but worked perfectly with my tries.

          This thread can be closed.

          1 Reply Last reply Reply Quote 0
          • C
            charliem last edited by

            Glad you got it working, but for future reference: the base64_encode of the password is used as the salt parameter for crypt().  More details on php crypt are here:
            http://us1.php.net/manual/en/function.crypt.php

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Products

            • Platform Overview
            • TNSR
            • pfSense
            • Appliances

            Services

            • Training
            • Professional Services

            Support

            • Subscription Plans
            • Contact Support
            • Product Lifecycle
            • Documentation

            News

            • Media Coverage
            • Press
            • Events

            Resources

            • Blog
            • FAQ
            • Find a Partner
            • Resource Library
            • Security Information

            Company

            • About Us
            • Careers
            • Partners
            • Contact Us
            • Legal
            Our Mission

            We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

            Subscribe to our Newsletter

            Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

            © 2021 Rubicon Communications, LLC | Privacy Policy