public static function _encryptAESPKCS7($str, $key = _CryptConfig::AES_KEY, $cipher = _CryptConfig::CIPHER, $mode = _CryptConfig::MODE) {
        $key = self::_chopKeyForAES($key);
        $block = mcrypt_get_block_size($cipher, $mode);
        $pad = $block - (strlen($str) % $block);
        $str .= str_repeat(chr($pad), $pad);
        $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher, $mode), MCRYPT_DEV_URANDOM);
        $encrypted = mcrypt_encrypt($cipher, $key, $str, $mode, $iv);
        $ret = base64_encode($iv) . base64_encode($encrypted);
        return $ret;
    }