LIFE_CYCLE-CIPHER(7ossl)
π
LIFE_CYCLE-CIPHER β the cipher algorithm life-cycle (yes, it's an OpenSSL 7ossl page, bestie)
okay so you found life_cycle-cipher(7ossl), the OpenSSL manpage that maps out the entire ~journey~ a symmetric cipher goes on. Think of it as the group chat history of a CIPHER: who added it, when it got set up, when it started actually doing stuff, and when it got yeeted out of memory. Sit down, bestie, we're going through all of it. π¦
β¨ NAME β¨
life_cycle-cipher β The cipher algorithm life-cycle. literally the whole plot. π
πΈ DESCRIPTION πΈ
All symmetric ciphers (CIPHERs) go through a number of stages in their life-cycle, and no cap, each one has main character energy at a different moment:
startβ This state represents the CIPHER before it has been allocated. It is the starting state for any life-cycle transitions.newedβ This state represents the CIPHER after it has been allocated.initialisedβ These states represent the CIPHER when it is set up and capable of processing 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 represent the CIPHER when it is set up and capable of processing additional input or generating output. The three possible states directly correspond to those for initialised above. The three different streams should not be mixed. π« (fr fr, don't mix them, that's not the vibe)finaledβ This state represents the CIPHER when it has generated output. slay, it did the thing.freedβ This state is entered when the CIPHER is freed. It is the terminal state for all life-cycle transitions. goodbye forever bestie π«Ά
π State Transition Diagram π
The usual life-cycle of a CIPHER is illustrated:
+---------------------------+
| |
| start |
| |
+---------------------------+ + - - -
- - - - - - - - - - +
| ' any
of the initialised '
| EVP_CIPHER_CTX_new '
updated or finaled states '
v '
'
+---------------------------+ + - - -
- - - - - - - - - - +
| | |
| newed | |
EVP_CIPHER_CTX_reset
| | <----+
+---------------------------+
| | |
+---------+ | +---------+
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 |
| |
+---------------------------+
π Formal State Transitions π
This section defines all of the legal state transitions. This is the canonical list. it's giving receipts, it's giving lore, it's giving iykyk.
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
so yeah, that's the canonical chart β function call on the left, current state across the top, resulting state in the cell. read it like a grid and you're golden. β
π₯ NOTES π₯
At some point the EVP layer will begin enforcing the transitions described herein. so likeβ¦ these aren't just suggestions forever, bestie. behave. π
π SEE ALSO π
go read those too, they're iconic in their own right π
π 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>.
k bye bestie π
this little masterpiece is OpenSSL version 3.5.6, dated 2026-04-07, and you can find it chilling under the name LIFE_CYCLE-CIPHER(7ossl). ily, go initialise something πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms