Encryption Process Flow

System Design · flowchart diagram · NOASSERTION

Illustrates the detailed flow of an encryption process, from password and plaintext input to ciphertext output, including key derivation, encoding, and cip

Source: https://github.com/laurent22/joplin/blob/9e46f80713c5b7c13d40a21b137539b644748ac0/readme/dev/spec/e2ee/native_encryption.md
Curated by laurent22
Encryption Cryptography Security Data Flow Key Derivation Cipher Encoding

Mermaid source

graph LR;
    pwd[Password]
    salt[Salt]
    kdf((KDF))
    key[Key]

    pt_str["Plaintext<br/>(string)"]
    pt_bin["Plaintext<br/>(binary)"]
    ct_str["Ciphertext<br/>(string)"]
    ct_bin["Ciphertext<br/>(binary)"]
    cipher((Cipher))
    codec_1((Encoder/<br/>Decoder))
    codec_2((Encoder/<br/>Decoder))

    pwd---salt
    pt_str---salt
    linkStyle 0,1 stroke-width:0px

    pwd-->kdf
    pt_str-->codec_1

    subgraph sub_1 ["EncryptionService.encrypt()"]
    direction LR
        codec_1-->pt_bin
        pt_bin-->cipher
        salt-->kdf
        kdf-->key
        key-->cipher
        cipher-->ct_bin
        ct_bin-->codec_2
    end
    codec_2-->ct_str

What this diagram shows

This diagram details the steps involved in an encryption service's 'encrypt()' function. It shows how a password and salt are used by a Key Derivation Function (KDF) to generate a cryptographic key. The plaintext string is encoded into a binary format, then encrypted by a cipher using the derived key, and finally the resulting ciphertext binary is encoded back into a string.

When to use it

Use this diagram to explain the internal workings of a data encryption mechanism, to document cryptographic operations within an application, or to visualize secure data handling processes.

How to adapt it for your project

Adapt this diagram by specifying particular KDF algorithms (e.g., PBKDF2, scrypt), cipher types (e.g., AES, RSA), or encoding schemes. It can be extended to include decryption steps, key rotation, or integration with hardware security modules (HSMs).

Key concepts