mysqlAES
[ class tree: mysqlAES ] [ index: mysqlAES ] [ all elements ]

Class: mysqlAES

Source Location: /mysqlAES.php

Class Overview


mysqlAES 패키지는 MySQL의 AES_EMCRYPT, AES_DECRYPT, HEX, UNHEX 함수를 php에서 호환되게 사용할 수 있도록 하는 기능을 제공한다.


Variables

Constants

Methods



Class Details

[line 47]
mysqlAES 패키지는 MySQL의 AES_EMCRYPT, AES_DECRYPT, HEX, UNHEX 함수를 php에서 호환되게 사용할 수 있도록 하는 기능을 제공한다.

encrypt method와 decrypt method의 경우, key 길이가 128bit(16byte)이면 MySQL과 MariaDB의 AES_ENCRYPT/AES_DECRYPT 함수와 완벽하게 호환이 된다.

key 길이가 192또는 256bit일 경우에는 oops에서 제공하는 lib_mysqludf_aes256 UDF에서 제공하는 AES256_ENCRYPT, AES256_DECRYPT와 완변하게 호환이 된다.

예제:




    [ Top ]


    Class Variables

    static $extname =  null

    [line 61]

    Variables for separating mcrypt or openssl extensions.

    mcrypt takes precedence over openssl.




    Tags:

    access:  public

    Type:   string


    [ Top ]



    Class Methods


    static method decrypt [line 216]

    static string decrypt( string $cipher, string $key)

    Decrypt using AES

    This method is compatible AES_DECRYPT function of mysql, if key is 128 bit And then, If key is 192 or 256 bit, this method is compatible follow APIS:

    Example:




      Tags:

      return:  decrypted data by AES. If $cipyer or $key has empty value, return null.
      access:  public


      Parameters:

      string   $cipher   cipher data for being decryption
      string   $key   decryption key
      • 128bit : 16 byte string
      • 192bit : 24 byte string
      • 256bit : 32 byte string

      [ Top ]

      static method encrypt [line 160]

      static string encrypt( string $cipher, string $key)

      Encrypt using AES

      This method is compatible AES_ENCRYPT function of mysql, if key is 128 bit. And then, If key is 192 or 256 bit, this method is compatible follow APIS:

      Example:




        Tags:

        return:  encrypted data by AES. If $cipyer or $key has empty value, return null
        access:  public


        Parameters:

        string   $cipher   The plaintext message data to be encrypted.
        string   $key   encryption key
        • 128bit : 16 byte string
        • 192bit : 24 byte string
        • 256bit : 32 byte string

        [ Top ]

        static method hex [line 90]

        static string hex( string $v)

        Return a hexadecimal representation of a decimal or string value

        This method is compatible HEX function of mysql

        Example:




          Tags:

          return:  hexadecimal data. If given parameter $v is empty, return null.
          access:  public


          Parameters:

          string   $v   original data

          [ Top ]

          static method unhex [line 111]

          static string unhex( string $v)

          Return a string containing hex representation of a number

          This method is compatible UNHEX function of mysql

          Example:




            Tags:

            return:  Returns an ASCII string containing the hexadecimal representation. If given parameter $v is empty, return null.
            access:  public


            Parameters:

            string   $v   hexadecimal data

            [ Top ]

            constructor __construct [line 69]

            mysqlAES __construct( )

            mysqlAES 초기화



            Tags:

            access:  public


            [ Top ]


            Class Constants

            AES_BLOCK_SIZE =  16

            [line 52]

            AES block 사이즈


            [ Top ]



            Documentation generated on Sun, 25 Feb 2018 07:14:52 +0900 by phpDocumentor 1.4.4