{
    "content": [
        {
            "type": "text",
            "text": "# Filter::decrypt (perldoc)\n\n## NAME\n\nFilter::decrypt - template for a decrypt source filter\n\n## SYNOPSIS\n\nuse Filter::decrypt ;\n\n## DESCRIPTION\n\nThis is a sample decrypting source filter.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **WARNING**\n- **EXAMPLES**\n- **AUTHOR**\n- **DATE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Filter::decrypt",
        "section": "",
        "mode": "perldoc",
        "summary": "Filter::decrypt - template for a decrypt source filter",
        "synopsis": "use Filter::decrypt ;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "See /usr/share/doc/libfilter-perl/examples/decrypt/ for examples of encryption and decryption",
            "scripts using this filter."
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "WARNING",
                "lines": 50,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DATE",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Filter::decrypt - template for a decrypt source filter\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Filter::decrypt ;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This is a sample decrypting source filter.\n\nAlthough this is a fully functional source filter and it does implement a *very* simple decrypt\nalgorithm, it is *not* intended to be used as it is supplied. Consider it to be a template which\nyou can combine with a proper decryption algorithm to develop your own decryption filter.\n",
                "subsections": []
            },
            "WARNING": {
                "content": "It is important to note that a decryption filter can *never* provide complete security against\nattack. At some point the parser within Perl needs to be able to scan the original decrypted\nsource. That means that at some stage fragments of the source will exist in a memory buffer.\n\nAlso, with the introduction of the Perl Compiler backend modules, and the B::Deparse module in\nparticular, using a Source Filter to hide source code is becoming an increasingly futile\nexercise.\n\nThe best you can hope to achieve by decrypting your Perl source using a source filter is to make\nit unavailable to the casual user.\n\nGiven that proviso, there are a number of things you can do to make life more difficult for the\nprospective cracker.\n\n1.   Strip the Perl binary to remove all symbols.\n\n2.   Build the decrypt extension using static linking. If the extension is provided as a dynamic\nmodule, there is nothing to stop someone from linking it at run time with a modified Perl\nbinary.\n\n3.   Do not build Perl with \"-DDEBUGGING\". If you do then your source can be retrieved with the\n\"-DP\" command line option.\n\nThe sample filter contains logic to detect the \"DEBUGGING\" option.\n\n4.   Do not build Perl with C debugging support enabled.\n\n5.   Do not implement the decryption filter as a sub-process (like the cpp source filter). It is\npossible to peek into the pipe that connects to the sub-process.\n\n6.   Check that the Perl Compiler isn't being used.\n\nThere is code in the BOOT: section of decrypt.xs that shows how to detect the presence of\nthe Compiler. Make sure you include it in your module.\n\nAssuming you haven't taken any steps to spot when the compiler is in use and you have an\nencrypted Perl script called \"myscript.pl\", you can get access the source code inside it\nusing the perl Compiler backend, like this\n\nperl -MO=Deparse myscript.pl\n\nNote that even if you have included the BOOT: test, it is still possible to use the Deparse\nmodule to get the source code for individual subroutines.\n\n7.   Do not use the decrypt filter as-is. The algorithm used in this filter has been\npurposefully left simple.\n\nIf you feel that the source filtering mechanism is not secure enough you could try using the\nunexec/undump method. See the Perl FAQ for further details.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "See /usr/share/doc/libfilter-perl/examples/decrypt/ for examples of encryption and decryption\nscripts using this filter.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Paul Marquess\n",
                "subsections": []
            },
            "DATE": {
                "content": "19th December 1995\n",
                "subsections": []
            }
        }
    }
}