PHP Encryption

Discussion in 'PHP' started by katty.jonh, Jul 25, 2012.

  1. #1
    Hi,What’s the difference between md5(), crc32() and sha1() crypto on PHP?
     
    katty.jonh, Jul 25, 2012 IP
  2. freenet

    freenet Peon

    Messages:
    21
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #2
    On wikipedia you have more and more detail about md5, crc32 and sha1 ;)
     
    freenet, Jul 25, 2012 IP
  3. kristenmorey111

    kristenmorey111 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    kristenmorey111, Jul 25, 2012 IP
  4. Sitesupplier

    Sitesupplier Peon

    Messages:
    16
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Ideally you'd want to use the hash() function in PHP to encrypt your data. Using the SHA512 encryption algorithm is probably the most powerful algorithm currently, along with a salt makes for a hard-to-crack password or other data. Something along the lines of this:
    
    // Salting should be much more thorough than this with a better random number generator.
    $salt = rand(1000,99999);
    
    $password = $_POST['password'];
    $password = hash("sha512", $password.$salt);
    
    Code (markup):
     
    Sitesupplier, Jul 30, 2012 IP
  5. cheochi

    cheochi Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Useful information shared.Thanks
     
    cheochi, Aug 1, 2012 IP
  6. PHPlancer

    PHPlancer Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    People need to understand that encrypting and hashing are two entirely different thing.
     
    PHPlancer, Aug 1, 2012 IP