# sbmueller/gr-openssl architecture

> Architecture diagram of the GitHub repository sbmueller/gr-openssl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sbmueller/gr-openssl
- Repository: https://github.com/sbmueller/gr-openssl

## Overview

gr-openssl is a GNU Radio add-on that provides OpenSSL-backed cryptographic blocks. A flow uses symmetric PDU or tagged-stream blocks to encrypt and decrypt data, with IVs carried in metadata or tags; it can also hash PDUs and generate or derive keys. AES-GCM PDU blocks add authenticated encryption. The graph focuses on runtime capabilities documented in the README and sampled implementations; key generation and some block details are documented but their implementation excerpts were not provided.

Main entry points: [`lib/sym_enc_impl.cc`](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_enc_impl.cc) (PDU encrypt), [`lib/sym_enc_tagged_bb_impl.cc`](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_enc_tagged_bb_impl.cc) (Tagged encrypt), [`lib/auth_enc_aes_gcm_impl.cc`](https://github.com/sbmueller/gr-openssl/blob/master/lib/auth_enc_aes_gcm_impl.cc) (AES-GCM encrypt), [`lib/sym_dec_impl.cc`](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_dec_impl.cc) (PDU decrypt)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_symmetric_pdu["Symmetric PDU"]
  node_sym_encrypt["PDU encrypt<br/>[sym_enc_impl.cc]"]
  node_sym_decrypt["PDU decrypt<br/>[sym_dec_impl.cc]"]
end

subgraph group_tagged_stream["Tagged Streams"]
  node_tag_encrypt["Tagged encrypt"]
  node_tag_decrypt["Tagged decrypt"]
end

subgraph group_authenticated["Authenticated PDU"]
  node_gcm_encrypt["AES-GCM encrypt"]
  node_gcm_decrypt["AES-GCM decrypt"]
end

subgraph group_crypto_support["Crypto Support"]
  node_hash["PDU digest<br/>[hash_impl.cc]"]
  node_keygen["Key generation<br/>[key.cc]"]
  node_cipher_desc["Cipher descriptor<br/>[sym_ciph_desc.cc]"]
end

node_flow_user(("GNU Radio flow"))
node_openssl["OpenSSL"]

node_flow_user -->|"sends PDUs"| node_sym_encrypt
node_flow_user -->|"sends PDUs"| node_sym_decrypt
node_flow_user -->|"sends stream"| node_tag_encrypt
node_flow_user -->|"sends stream"| node_tag_decrypt
node_flow_user -->|"sends PDUs"| node_gcm_encrypt
node_flow_user -->|"sends PDUs"| node_gcm_decrypt
node_flow_user -->|"sends PDUs"| node_hash
node_flow_user -->|"requests keys"| node_keygen
node_sym_encrypt -->|"encrypts for"| node_sym_decrypt
node_tag_encrypt -->|"encrypts for"| node_tag_decrypt
node_gcm_encrypt -->|"encrypts for"| node_gcm_decrypt
node_sym_encrypt -->|"encrypts with"| node_openssl
node_sym_decrypt -->|"decrypts with"| node_openssl
node_tag_encrypt -->|"encrypts with"| node_openssl
node_tag_decrypt -->|"decrypts with"| node_openssl
node_gcm_encrypt -->|"encrypts with"| node_openssl
node_gcm_decrypt -->|"decrypts with"| node_openssl
node_hash -->|"hashes with"| node_openssl

click node_sym_encrypt "https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_enc_impl.cc"
click node_sym_decrypt "https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_dec_impl.cc"
click node_tag_encrypt "https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_enc_tagged_bb_impl.cc"
click node_tag_decrypt "https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_dec_tagged_bb_impl.cc"
click node_gcm_encrypt "https://github.com/sbmueller/gr-openssl/blob/master/lib/auth_enc_aes_gcm_impl.cc"
click node_gcm_decrypt "https://github.com/sbmueller/gr-openssl/blob/master/lib/auth_dec_aes_gcm_impl.cc"
click node_hash "https://github.com/sbmueller/gr-openssl/blob/master/lib/hash_impl.cc"
click node_keygen "https://github.com/sbmueller/gr-openssl/blob/master/lib/key.cc"
click node_cipher_desc "https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_ciph_desc.cc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sym_encrypt,node_sym_decrypt toneBlue
class node_tag_encrypt,node_tag_decrypt toneAmber
class node_gcm_encrypt,node_gcm_decrypt toneMint
class node_hash,node_keygen,node_cipher_desc toneRose
class node_flow_user,node_openssl toneIndigo
```

## Components

### Symmetric PDU

- [PDU encrypt](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_enc_impl.cc): `lib/sym_enc_impl.cc`
- [PDU decrypt](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_dec_impl.cc): `lib/sym_dec_impl.cc`

### Tagged Streams

- [Tagged encrypt](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_enc_tagged_bb_impl.cc): `lib/sym_enc_tagged_bb_impl.cc`
- [Tagged decrypt](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_dec_tagged_bb_impl.cc): `lib/sym_dec_tagged_bb_impl.cc`

### Authenticated PDU

- [AES-GCM encrypt](https://github.com/sbmueller/gr-openssl/blob/master/lib/auth_enc_aes_gcm_impl.cc): `lib/auth_enc_aes_gcm_impl.cc`
- [AES-GCM decrypt](https://github.com/sbmueller/gr-openssl/blob/master/lib/auth_dec_aes_gcm_impl.cc): `lib/auth_dec_aes_gcm_impl.cc`

### Crypto Support

- [PDU digest](https://github.com/sbmueller/gr-openssl/blob/master/lib/hash_impl.cc): `lib/hash_impl.cc`
- [Key generation](https://github.com/sbmueller/gr-openssl/blob/master/lib/key.cc): `lib/key.cc`
- [Cipher descriptor](https://github.com/sbmueller/gr-openssl/blob/master/lib/sym_ciph_desc.cc): `lib/sym_ciph_desc.cc`

### Other components

- **GNU Radio flow**
- **OpenSSL**

## Connections

- GNU Radio flow → PDU encrypt: sends PDUs
- GNU Radio flow → PDU decrypt: sends PDUs
- GNU Radio flow → Tagged encrypt: sends stream
- GNU Radio flow → Tagged decrypt: sends stream
- GNU Radio flow → AES-GCM encrypt: sends PDUs (evidence: `lib/auth_enc_aes_gcm_impl.cc`)
- GNU Radio flow → AES-GCM decrypt: sends PDUs (evidence: `lib/auth_dec_aes_gcm_impl.cc`)
- GNU Radio flow → PDU digest: sends PDUs
- GNU Radio flow → Key generation: requests keys
- PDU encrypt → PDU decrypt: encrypts for
- Tagged encrypt → Tagged decrypt: encrypts for
- AES-GCM encrypt → AES-GCM decrypt: encrypts for
- PDU encrypt → OpenSSL: encrypts with (evidence: `lib/sym_enc_impl.cc`)
- PDU decrypt → OpenSSL: decrypts with (evidence: `lib/sym_dec_impl.cc`)
- Tagged encrypt → OpenSSL: encrypts with (evidence: `lib/sym_enc_tagged_bb_impl.cc`)
- Tagged decrypt → OpenSSL: decrypts with (evidence: `lib/sym_dec_tagged_bb_impl.cc`)
- AES-GCM encrypt → OpenSSL: encrypts with (evidence: `lib/auth_enc_aes_gcm_impl.cc`)
- AES-GCM decrypt → OpenSSL: decrypts with (evidence: `lib/auth_dec_aes_gcm_impl.cc`)
- PDU digest → OpenSSL: hashes with
