{
    "content": [
        {
            "type": "text",
            "text": "# Crypt::Rijndael (perldoc)\n\n## NAME\n\nCrypt::Rijndael - Crypt::CBC compliant Rijndael encryption module\n\n## SYNOPSIS\n\nuse Crypt::Rijndael;\n# keysize() is 32, but 24 and 16 are also possible\n# blocksize() is 16\n$cipher = Crypt::Rijndael->new( \"a\" x 32, Crypt::Rijndael::MODECBC() );\n$cipher->setiv($iv);\n$crypted = $cipher->encrypt($plaintext);\n# - OR -\n$plaintext = $cipher->decrypt($crypted);\n\n## DESCRIPTION\n\nThis module implements the Rijndael cipher, which has just been selected as the Advanced\nEncryption Standard.\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION** (1 subsections)\n- **SEE ALSO**\n- **BUGS**\n- **AUTHOR**\n- **SOURCE**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Crypt::Rijndael",
        "section": "",
        "mode": "perldoc",
        "summary": "Crypt::Rijndael - Crypt::CBC compliant Rijndael encryption module",
        "synopsis": "use Crypt::Rijndael;\n# keysize() is 32, but 24 and 16 are also possible\n# blocksize() is 16\n$cipher = Crypt::Rijndael->new( \"a\" x 32, Crypt::Rijndael::MODECBC() );\n$cipher->setiv($iv);\n$crypted = $cipher->encrypt($plaintext);\n# - OR -\n$plaintext = $cipher->decrypt($crypted);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 33,
                "subsections": [
                    {
                        "name": "Encryption modes",
                        "lines": 9
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SOURCE",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Crypt::Rijndael - Crypt::CBC compliant Rijndael encryption module\n",
                "subsections": []
            },
            "VERSION": {
                "content": "Version 1.16\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Crypt::Rijndael;\n\n# keysize() is 32, but 24 and 16 are also possible\n# blocksize() is 16\n\n$cipher = Crypt::Rijndael->new( \"a\" x 32, Crypt::Rijndael::MODECBC() );\n\n$cipher->setiv($iv);\n$crypted = $cipher->encrypt($plaintext);\n# - OR -\n$plaintext = $cipher->decrypt($crypted);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module implements the Rijndael cipher, which has just been selected as the Advanced\nEncryption Standard.\n\nkeysize\nReturns the keysize, which is 32 (bytes). The Rijndael cipher actually supports keylengths\nof 16, 24 or 32 bytes, but there is no way to communicate this to \"Crypt::CBC\".\n\nblocksize\nThe blocksize for Rijndael is 16 bytes (128 bits), although the algorithm actually supports\nany blocksize that is any multiple of our bytes. 128 bits, is however, the AES-specified\nblock size, so this is all we support.\n\n$cipher = Crypt::Rijndael->new( $key [, $mode] )\nCreate a new \"Crypt::Rijndael\" cipher object with the given key (which must be 128, 192 or\n256 bits long). The additional $mode argument is the encryption mode, either \"MODEECB\"\n(electronic codebook mode, the default), \"MODECBC\" (cipher block chaining, the same that\n\"Crypt::CBC\" does), \"MODECFB\" (128-bit cipher feedback), \"MODEOFB\" (128-bit output\nfeedback), or \"MODECTR\" (counter mode).\n\nECB mode is very insecure (read a book on cryptography if you don't know why!), so you\nshould probably use CBC mode.\n\n$cipher->setiv($iv)\nThis allows you to change the initial value vector used by the chaining modes. It is not\nrelevant for ECB mode.\n\n$cipher->encrypt($data)\nEncrypt data. The size of $data must be a multiple of \"blocksize\" (16 bytes), otherwise this\nfunction will croak. Apart from that, it can be of (almost) any length.\n\n$cipher->decrypt($data)\nDecrypts $data.\n",
                "subsections": [
                    {
                        "name": "Encryption modes",
                        "content": "Use these constants to select the cipher type:\n\nMODECBC - Cipher Block Chaining\nMODECFB - Cipher feedback\nMODECTR - Counter mode\nMODEECB - Electronic cookbook mode\nMODEOFB - Output feedback\nMODEPCBC - ignore this one for now :)\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "Crypt::CBC, http://www.csrc.nist.gov/encryption/aes/\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Should EXPORT or EXPORTOK the MODE constants.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Currently maintained by Leon Timmermans \"leont@cpan.org\".\n\nPreviously maintained by brian d foy, \"<bdfoy@cpan.org>\".\n\nOriginal code by Rafael R. Sevilla.\n\nThe Rijndael Algorithm was developed by Vincent Rijmen and Joan Daemen, and has been selected as\nthe US Government's Advanced Encryption Standard.\n",
                "subsections": []
            },
            "SOURCE": {
                "content": "This code is in Github:\n\ngit://github.com/leont/crypt-rijndael.git\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "This software is licensed under the Lesser GNU Public License v3 (29 June 2007). See the\nincluded COPYING file for details.\n",
                "subsections": []
            }
        }
    }
}