LIFE_CYCLE-CIPHER(7ossl)
π LIFE_CYCLE-CIPHER(7ossl) β the cipher algorithm life-cycle, bestie β¨
okay so this is a page from the OpenSSL manual, and it's about how symmetric ciphers (CIPHERs) live their whole little lives π
πΈ NAME
life_cycle-cipher β the cipher algorithm life-cycle, fr fr
β¨ DESCRIPTION
So basically every single symmetric cipher (aka a CIPHER) goes through a bunch of stages in its life-cycle, like a whole character arc π here's the tea:
startβ this is the CIPHER before it's even been allocated. it's giving "not yet born," the starting state for every life-cycle transition π«newedβ this is the CIPHER after it's been allocated. freshly newed, main character energy πinitialisedβ these states are when the CIPHER is set up and ready to process input. there are three possible initialised states:- initialised using
EVP_CipherInit - initialised for decryption using
EVP_DecryptInit - initialised for encryption using
EVP_EncryptInit
- initialised using
updatedβ these states are when it's set up and capable of processing additional input or generating output. the three possible states directly correspond to those for initialised above. and listen β the three different streams should not be mixed π ββοΈ like don't cross the streams, that's not the vibefinaledβ this state is when the CIPHER has generated output. it's done, it ate, periodt πfreedβ entered when the CIPHER is freed. it's the terminal state for all life-cycle transitions. rip little cipher π«‘
π¦ State Transition Diagram
the usual life-cycle of a CIPHER is illustrated like this (ngl it's kind of a lot, but iykyk):
+---------------------------+
| |
| start |
| |
+---------------------------+ + - - - - - - - - - - +
| ' any of the initialised '
| EVP_CIPHER_CTX_new ' updated or finaled states '
v ' '
+---------------------------+ + - - - - - - - - - - +
| | |
| newed | |
| | <----+
+---------------------------+
| | |
+---------+ | +---------+
EVP_DecryptInit | | EVP_CipherInit | EVP_EncryptInit
v v v
+---------------------------+ +---------------------------+ +---------------------------+
| | | | | |
| initialised | | initialised | | initialised |
| for decryption | | | | for encryption |
+---------------------------+ +---------------------------+ +---------------------------+
| | |
| EVP_DecryptUpdate | EVP_CipherUpdate | EVP_EncryptUpdate
| v |
| +---------------------------+ |
| | |-----+ |
| | updated | EVP_CipherUpdate | |
| | | <------------------+ |
v +---------------------------+ v
+---------------------------+ | +---------------------------+
| |---------------------+ | | |
| updated | EVP_DecryptUpdate | | | updated |------+
| for decryption | <-------------------+ | | for encryption | |
+---------------------------+ | +---------------------------+ |
| EVP_CipherFinal | ^ |
+-------+ | +--------+ |
EVP_DecryptFinal | | | EVP_EncryptFinal +-------------------+
v v v EVP_EncryptUpdate
+---------------------------+ |-----------------------------+
| finaled | |
| | <---------------------------+
+---------------------------+ EVP_CIPHER_CTX_get_params
| (AEAD encryption)
| EVP_CIPHER_CTX_free
v
+---------------------------+
| |
| freed |
| |
+---------------------------+
look, i know that diagram is a lot π but it's iconic, we don't gatekeep π
π Formal State Transitions
this section defines all of the legal state transitions β it's the canonical list, no cap. here's the full table of which function call does what from which current state:
Function Call
---------------------------------------------- Current State
-----------------------------------------------
start newed initialised updated finaled initialised updated initialised updated freed
decryption decryption encryption encryption
EVP_CIPHER_CTX_new newed
EVP_CipherInit initialised initialised initialised initialised initialised initialised initialised initialised
EVP_DecryptInit initialised initialised initialised initialised initialised initialised initialised initialised
decryption decryption decryption decryption decryption decryption decryption decryption
EVP_EncryptInit initialised initialised initialised initialised initialised initialised initialised initialised
encryption encryption encryption encryption encryption encryption encryption encryption
EVP_CipherUpdate updated updated
EVP_DecryptUpdate
updated updated
decryption decryption
EVP_EncryptUpdate
updated updated
encryption encryption
EVP_CipherFinal finaled
EVP_DecryptFinal
finaled
EVP_EncryptFinal
finaled
EVP_CIPHER_CTX_free freed freed freed freed freed freed freed freed freed
EVP_CIPHER_CTX_reset newed newed newed newed newed newed newed newed
EVP_CIPHER_CTX_get_params newed initialised updated initialised updated initialised updated
decryption decryption encryption encryption
EVP_CIPHER_CTX_set_params newed initialised updated initialised updated initialised updated
decryption decryption encryption encryption
EVP_CIPHER_CTX_gettable_params newed initialised updated initialised updated initialised updated
decryption decryption encryption encryption
EVP_CIPHER_CTX_settable_params newed initialised updated initialised updated initialised updated
decryption decryption encryption encryption
bestie that table is A LOT but it's literally all the lore, every single transition, we keep it all π―
π NOTES
at some point the EVP layer will begin enforcing the transitions described herein. so like, these aren't just suggestions forever, okay? pay attention π
π SEE ALSO
Β©οΈ COPYRIGHT
Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
okay that's the whole thing, you understood it perfectly, i'm so proud of you bestie π«Άπ version 3.5.0, dated 2026-09-25, and it's the LIFE_CYCLE-CIPHER(7ossl) page β slay, you now know cipher life-cycles better than most people ngl β¨
π¦ where this page comes from
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- opensuse-leap 16.0: openssl-3 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms