Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member rs-freddo's Avatar
    Join Date
    May 2003
    Location
    Australia
    Posts
    836
    cPanel/Enkompass Access Level

    Root Administrator

    Default Perl commandline guru advice needed...

    I'm writing a PHP script that needs to use the perl crypt function to hash a string. The easiest way to do this is to do the perl crypt function on the commandline. Currently I get no output, so I'm doing something wrong.

    I've tried:
    perl -e -p "crypt(string, salt);"
    and various permutations, with no output. Any ideas what I'm doing wrong?

    My last resort will be to write a small perl script to do the crypt and generate output - i know that will work.
    Michael

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    If you want a (mostly) random salt:

    perl -e "print crypt ('test',rand(time))"
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member rs-freddo's Avatar
    Join Date
    May 2003
    Location
    Australia
    Posts
    836
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Thanks chirpy, that worked.
    Michael

Similar Threads & Tags
Similar threads

  1. Advice Needed
    By markholland8 in forum Data Protection
    Replies: 4
    Last Post: 04-11-2009, 06:01 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube