Loading...
PHP

Encryption Function Supported by PHP

By this function we can encode and decode the input string it is divide into two types.
1. One way Encryption
2. Two way Encryption

  1. One way Encryption:
    By using this concept we can encode the string but we cannot decode the encoded string.
    mesg digest file: By using this function we can encode the input string as 32 characters length alpha numeric string.
    crc: This function converts input string as numeric encrypted data .
    <?php
    echo crc32(“Webnoid”);
    ?>
    sha1: Converts input string as 40 chars length, numeric string.
    echo sha1(“Webnoid”);
    crypt: Converts main code string as alpha numeric string with special characters this comes under one way encryption file.
    echo crypt(“Webnoid”);
  2. Two way Encryption:
    By using this function we can encode the input string as well as decode the encoded string.
    base64_encode:  By using this function we can encode the string as 64 bit encrypted data.
    echo base64_encode
    base64_decode: By this function we can decode the encrypted string of base64_encode function.
    echo base64_decode
    <?php
    $str=”Webnoid”;
    $str1=base64_encode($str);
    echo $str1;
    echo base64_decode($str1);
    ?>
Leave a Reply

Your email address will not be published. Required fields are marked *