{
    "content": [
        {
            "type": "text",
            "text": "# life_cycle-cipher(7ssl) (man)\n\n**Summary:** lifecycle-cipher - The cipher algorithm life-cycle\n\n## See Also\n\n- provider-cipher(7)\n- EVPEncryptInit(3)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (28 lines) — 2 subsections\n  - State Transition Diagram (73 lines)\n  - Formal State Transitions (53 lines)\n- **NOTES** (2 lines)\n- **SEE ALSO** (2 lines)\n- **COPYRIGHT** (9 lines)\n\n## Full Content\n\n### NAME\n\nlifecycle-cipher - The cipher algorithm life-cycle\n\n### DESCRIPTION\n\nAll symmetric ciphers (CIPHERs) go through a number of stages in their life-cycle:\n\nstart\nThis state represents the CIPHER before it has been allocated.  It is the starting state\nfor any life-cycle transitions.\n\nnewed\nThis state represents the CIPHER after it has been allocated.\n\ninitialised\nThese states represent the CIPHER when it is set up and capable of processing input.\nThere are three possible initialised states:\n\ninitialised using EVPCipherInit\ninitialised for decryption using EVPDecryptInit\ninitialised for encryption using EVPEncryptInit\nupdated\nThese states represent the CIPHER when it is set up and capable of processing additional\ninput or generating output.  The three possible states directly correspond to those for\ninitialised above.  The three different streams should not be mixed.\n\nfinaled\nThis state represents the CIPHER when it has generated output.\n\nfreed\nThis state is entered when the CIPHER is freed.  It is the terminal state for all life-\ncycle transitions.\n\n#### State Transition Diagram\n\nThe usual life-cycle of a CIPHER is illustrated:\n+---------------------------+\n|                           |\n|           start           |\n|                           |\n+---------------------------+   + - - - - - - - - - - - - -\n+\n|                         '  any of the initialised\n'\n| EVPCIPHERCTXnew      ' updated or finaled states\n'\nv                         '\n'\n+---------------------------+   + - - - - - - - - - - - - -\n+\n|                           |      |\n|           newed           |      | EVPCIPHERCTXreset\n|                           | <----+\n+---------------------------+\n|   |                 |\n+---------+   |                 +---------+\nEVPDecryptInit |             | EVPCipherInit            | EVPEncryptInit\nv             v                           v\n+---------------------------+   +---------------------------+\n+---------------------------+\n|                           |   |                           |   |\n|\n|        initialised        |   |        initialised        |   |        initialised\n|\n|       for decryption      |   |                           |   |       for encryption\n|\n+---------------------------+   +---------------------------+\n+---------------------------+\n|                                   |                                                   |\n| EVPDecryptUpdate                 | EVPCipherUpdate                EVPEncryptUpdate |\n|                                   v                                                   |\n|                             +---------------------------+                             |\n|                             |                           |--------------------+        |\n|                             |          updated          |   EVPCipherUpdate |        |\n|                             |                           | <------------------+        |\nv                             +---------------------------+                             v\n+---------------------------+                         |\n+---------------------------+\n|                           |---------------------+   |         |\n|\n|          updated          |   EVPDecryptUpdate |   |         |          updated\n|------+\n|       for decryption      | <-------------------+   |         |       for encryption\n|      |\n+---------------------------+                         |\n+---------------------------+      |\n|            EVPCipherFinal |            |           ^\n|\n+-------+                    |   +--------+           |\n|\nEVPDecryptFinal |                    |   | EVPEncryptFinal\n+-------------------+\nv                    v   v\nEVPEncryptUpdate\n+---------------------------+\n|                           |-----------------------------+\n|          finaled          |                             |\n|                           | <---------------------------+\n+---------------------------+   EVPCIPHERCTXgetparams\n|                             (AEAD encryption)\n| EVPCIPHERCTXfree\nv\n+---------------------------+\n|                           |\n|           freed           |\n|                           |\n+---------------------------+\n\n#### Formal State Transitions\n\nThis section defines all of the legal state transitions.  This is the canonical list.\nFunction Call                ---------------------------------------------- Current State\n-----------------------------------------------\nstart   newed    initialised   updated     finaled\ninitialised   updated    initialised   updated    freed\ndecryption\ndecryption   encryption  encryption\nEVPCIPHERCTXnew           newed\nEVPCipherInit                    initialised initialised initialised initialised\ninitialised initialised  initialised initialised\nEVPDecryptInit                   initialised initialised initialised initialised\ninitialised initialised  initialised initialised\ndecryption  decryption  decryption  decryption\ndecryption  decryption  decryption  decryption\nEVPEncryptInit                   initialised initialised initialised initialised\ninitialised initialised  initialised initialised\nencryption  encryption  encryption  encryption\nencryption  encryption  encryption  encryption\nEVPCipherUpdate                                updated     updated\nEVPDecryptUpdate                                                                   updated\nupdated\ndecryption\ndecryption\nEVPEncryptUpdate\nupdated     updated\nencryption\nencryption\nEVPCipherFinal                                             finaled\nEVPDecryptFinal\nfinaled\nEVPEncryptFinal\nfinaled\nEVPCIPHERCTXfree          freed   freed       freed       freed       freed       freed\nfreed        freed       freed\nEVPCIPHERCTXreset                 newed       newed       newed       newed       newed\nnewed        newed       newed\nEVPCIPHERCTXgetparams            newed    initialised   updated\ninitialised   updated    initialised   updated\ndecryption\ndecryption   encryption  encryption\nEVPCIPHERCTXsetparams            newed    initialised   updated\ninitialised   updated    initialised   updated\ndecryption\ndecryption   encryption  encryption\nEVPCIPHERCTXgettableparams       newed    initialised   updated\ninitialised   updated    initialised   updated\ndecryption\ndecryption   encryption  encryption\nEVPCIPHERCTXsettableparams       newed    initialised   updated\ninitialised   updated    initialised   updated\ndecryption\ndecryption   encryption  encryption\n\n### NOTES\n\nAt some point the EVP layer will begin enforcing the transitions described herein.\n\n### SEE ALSO\n\nprovider-cipher(7), EVPEncryptInit(3)\n\n### COPYRIGHT\n\nCopyright 2021 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed under the Apache License 2.0 (the \"License\").  You may not use this file except in\ncompliance with the License.  You can obtain a copy in the file LICENSE in the source\ndistribution or at <https://www.openssl.org/source/license.html>.\n\n\n\n3.0.2                                        2026-04-07                      LIFECYCLE-CIPHER(7SSL)\n\n"
        }
    ],
    "structuredContent": {
        "command": "life_cycle-cipher",
        "section": "7ssl",
        "mode": "man",
        "summary": "lifecycle-cipher - The cipher algorithm life-cycle",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "provider-cipher",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/provider-cipher/7/json"
            },
            {
                "name": "EVPEncryptInit",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/EVPEncryptInit/3/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 28,
                "subsections": [
                    {
                        "name": "State Transition Diagram",
                        "lines": 73
                    },
                    {
                        "name": "Formal State Transitions",
                        "lines": 53
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}