{
    "content": [
        {
            "type": "text",
            "text": "# Image::ExifTool::AES (perldoc)\n\n## NAME\n\nImage::ExifTool::AES - AES encryption with cipher-block chaining\n\n## SYNOPSIS\n\nuse Image::ExifTool::AES qw(Crypt);\n$err = Crypt(\\$plaintext, $key, 1);   # encryption\n$err = Crypt(\\$ciphertext, $key);     # decryption\n\n## DESCRIPTION\n\nThis module contains an implementation of the AES encryption/decryption algorithms with\ncipher-block chaining (CBC) and RFC 2898 PKCS #5 padding. This is the AESV2 and AESV3 encryption\nmode used in PDF documents.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXPORTS**\n- **METHODS** (1 subsections)\n- **BUGS**\n- **AUTHOR**\n- **REFERENCES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Image::ExifTool::AES",
        "section": "",
        "mode": "perldoc",
        "summary": "Image::ExifTool::AES - AES encryption with cipher-block chaining",
        "synopsis": "use Image::ExifTool::AES qw(Crypt);\n$err = Crypt(\\$plaintext, $key, 1);   # encryption\n$err = Crypt(\\$ciphertext, $key);     # decryption",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "ExifTool",
                "section": "3pm",
                "url": "https://www.chedong.com/phpMan.php/man/ExifTool/3pm/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "EXPORTS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Crypt",
                        "lines": 28
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "REFERENCES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Image::ExifTool::AES - AES encryption with cipher-block chaining\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Image::ExifTool::AES qw(Crypt);\n\n$err = Crypt(\\$plaintext, $key, 1);   # encryption\n\n$err = Crypt(\\$ciphertext, $key);     # decryption\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module contains an implementation of the AES encryption/decryption algorithms with\ncipher-block chaining (CBC) and RFC 2898 PKCS #5 padding. This is the AESV2 and AESV3 encryption\nmode used in PDF documents.\n",
                "subsections": []
            },
            "EXPORTS": {
                "content": "Exports nothing by default, but \"Crypt\" may be exported.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Crypt",
                        "content": "Implement AES encryption/decryption with cipher-block chaining.\n\nInputs:\n0) Scalar reference for data to encrypt/decrypt.\n\n1) Encryption key string (must have length 16, 24 or 32).\n\n2) [optional] Encrypt flag (false to decrypt).\n\n3) [optional] Flag to avoid removing padding after decrypting, or to avoid adding 16 bytes\nof padding before encrypting when data length is already a multiple of 16 bytes.\n\nReturns:\nOn success, the return value is undefined and the data is encrypted or decrypted as\nspecified. Otherwise returns an error string and the data is left in an indeterminate state.\n\nNotes:\nThe length of the encryption key dictates the AES mode, with lengths of 16, 24 and 32 bytes\nresulting in AES-128, AES-192 and AES-256.\n\nWhen encrypting, the input data may be any length and will be padded to an even 16-byte\nblock size using the specified padding technique. If the encrypt flag has length 16, it is\nused as the initialization vector for the cipher-block chaining, otherwise a random IV is\ngenerated. Upon successful return the data will be encrypted, with the first 16 bytes of the\ndata being the CBC IV.\n\nWhen decrypting, the input data begins with the 16-byte CBC initialization vector.\n"
                    }
                ]
            },
            "BUGS": {
                "content": "This code is blindingly slow. But in truth, slowing down processing is the main purpose of\nencryption, so this really can't be considered a bug.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "REFERENCES": {
                "content": "<http://www.hoozi.com/Articles/AESEncryption.htm>\n<http://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf>\n<http://www.faqs.org/rfcs/rfc3602.html>\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Image::ExifTool(3pm)\n",
                "subsections": []
            }
        }
    }
}