From 65cf7fbcf932a8406f3aa6e2a11aa4b1b7a692b7 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 8 Dec 2023 16:21:45 +0100 Subject: [PATCH] Improve diagrams --- book/source/11-decryption.md | 8 +-- book/source/drawio/PKESKv3-decryption.drawio | 30 ++++---- book/source/drawio/PKESKv3-decryption.svg | 2 +- book/source/drawio/SEIPDv1-decryption.drawio | 48 +++++++------ book/source/drawio/SEIPDv1-decryption.svg | 2 +- .../SEIPDv2-decryption-mk-derivation.drawio | 63 ++++++++-------- .../SEIPDv2-decryption-mk-derivation.svg | 2 +- book/source/drawio/SKESKv4-decryption.drawio | 71 ++++++++++--------- book/source/drawio/SKESKv4-decryption.svg | 2 +- 9 files changed, 115 insertions(+), 113 deletions(-) diff --git a/book/source/11-decryption.md b/book/source/11-decryption.md index 778c19a..88d7099 100644 --- a/book/source/11-decryption.md +++ b/book/source/11-decryption.md @@ -128,13 +128,7 @@ Since SEIPD version 1 is susceptible to downgrade attacks under certain scenario ``` To decrypt the contents of a version 1 SEIPD packet, the session-key obtained in the previous step is used. -The cipher algorithm is determined by TODO. - -```{admonition} TODO -:class: warning - -Describe in detail, how the cipher algorithm is obtained. -``` +The cipher algorithm is either extracted from the decrypted session-key (the algorithm ID is typically prefixed to the decrypted session-key), or - in case of a SKESK packet using the direct-method - taken from the SKESKs cipher algorithm field. Once the cipher is initialized, the whole encrypted data from the SEIPD packet is decrypted. diff --git a/book/source/drawio/PKESKv3-decryption.drawio b/book/source/drawio/PKESKv3-decryption.drawio index 235b4f1..b6e37fe 100644 --- a/book/source/drawio/PKESKv3-decryption.drawio +++ b/book/source/drawio/PKESKv3-decryption.drawio @@ -1,28 +1,28 @@ - + - + - + - + - + - + - + - + - + @@ -31,24 +31,24 @@ - + - + - + - + - + - + diff --git a/book/source/drawio/PKESKv3-decryption.svg b/book/source/drawio/PKESKv3-decryption.svg index 28e9267..da7e8d6 100644 --- a/book/source/drawio/PKESKv3-decryption.svg +++ b/book/source/drawio/PKESKv3-decryption.svg @@ -1,4 +1,4 @@ -
Secret Key
Key-ID: 0xB0B
Secret KeyKey-ID: 0x...
Asymmetric
Decryption
Asymmetric...
Symmetric Key
Symmetric Key
PKESKv3
PKESKv3
Key-ID: 0xB0B
Key-ID: 0xB0B
Asymmetric Algo.
Asymmetric Algo.
ciphertext
ciphertext
Enc. Session-Key
Enc. Session-Key
Text is not SVG - cannot display
\ No newline at end of file +
Secret Key
Key-ID: 0xB0B
Secret KeyKey-ID: 0x...
Asymmetric
Decryption
Asymmetric...
Cipher Algorithm
+
Session Key
Cipher Algorithm...
PKESKv3
PKESKv3
Key-ID: 0xB0B
Key-ID: 0xB0B
Asymmetric Algo.
Asymmetric Algo.
ciphertext
ciphertext
Enc. Session-Key
Enc. Session-Key
Text is not SVG - cannot display
\ No newline at end of file diff --git a/book/source/drawio/SEIPDv1-decryption.drawio b/book/source/drawio/SEIPDv1-decryption.drawio index 4e86af7..adf2f4c 100644 --- a/book/source/drawio/SEIPDv1-decryption.drawio +++ b/book/source/drawio/SEIPDv1-decryption.drawio @@ -1,53 +1,49 @@ - + - + - + - + - - - - + - + - + - + - + - + - + - - + + + + - + - - - - + @@ -55,14 +51,20 @@ - + - + + + + + + + diff --git a/book/source/drawio/SEIPDv1-decryption.svg b/book/source/drawio/SEIPDv1-decryption.svg index 09c1962..708593e 100644 --- a/book/source/drawio/SEIPDv1-decryption.svg +++ b/book/source/drawio/SEIPDv1-decryption.svg @@ -1,4 +1,4 @@ -
key
key
Message-Key
(Session-Key)
Message-Key(Session-...
SEIPDv1
SEIPDv1
Encrypted Data
Encrypted Data
Symmetric
Decryption
Symmetric...
algorithm
algorithm
Extract
Cipher
Algorithm
Extract...
ciphertext
ciphertext
Plaintext
Plaintext
Text is not SVG - cannot display
\ No newline at end of file +
key
key
Message-Key
(Session-Key)
Message-Key(Session-...
SEIPDv1
SEIPDv1
Encrypted Data
Encrypted Data
Symmetric
Decryption
Symmetric...
algorithm
algorithm
ciphertext
ciphertext
Plaintext
Plaintext
Cipher Algorithm
Cipher Algorithm
(obtained from PKESK / SKESK)
(obtained from PKESK / SKESK)
Text is not SVG - cannot display
\ No newline at end of file diff --git a/book/source/drawio/SEIPDv2-decryption-mk-derivation.drawio b/book/source/drawio/SEIPDv2-decryption-mk-derivation.drawio index 5f7dba1..24dfd8d 100644 --- a/book/source/drawio/SEIPDv2-decryption-mk-derivation.drawio +++ b/book/source/drawio/SEIPDv2-decryption-mk-derivation.drawio @@ -1,13 +1,13 @@ - + - + - + - + @@ -15,31 +15,31 @@ - + - + - + - + - + - + - + - + - + @@ -49,32 +49,32 @@ - + - + - + - + - + - + - - + + - + @@ -82,7 +82,7 @@ - + @@ -90,29 +90,32 @@ - + - + - + - + - + - + - + + + + diff --git a/book/source/drawio/SEIPDv2-decryption-mk-derivation.svg b/book/source/drawio/SEIPDv2-decryption-mk-derivation.svg index 7491d2d..0619eda 100644 --- a/book/source/drawio/SEIPDv2-decryption-mk-derivation.svg +++ b/book/source/drawio/SEIPDv2-decryption-mk-derivation.svg @@ -1,4 +1,4 @@ -
Message-Key
Message-Key
SEIPDv2
SEIPDv2
Cipher Algo.
Cipher Algo.
AEAD Algo.
AEAD Algo.
Chunk Size
Chunk Size
salt
salt
Salt
Salt
Encrypted Data
Encrypted Data
Final AEAD
Auth Tag
Final AEAD...
IKM
IKM
Session-Key
(decrypted from PKESK/SKESK)
Session-Key...
HKDF
HKDF
IV
IV
info
info
Packet Type ID,
Version Number,
Cipher Algo,
AEAD Algo,
Chunk Size
Packet Type ID,...
Packet Type, Version
Packet Type, Version
+
+
Text is not SVG - cannot display
\ No newline at end of file +
Message-Key
Message-Key
SEIPDv2
SEIPDv2
Cipher Algo.
Cipher Algo.
AEAD Algo.
AEAD Algo.
Chunk Size
Chunk Size
salt
salt
Salt
Salt
Encrypted Data
Encrypted Data
Final AEAD
Auth Tag
Final AEAD...
IKM
IKM
Session-Key
Session-Key
HKDF
HKDF
IV
IV
info
info
Packet Type ID,
Version Number,
Cipher Algo,
AEAD Algo,
Chunk Size
Packet Type ID,...
Packet Type, Version
Packet Type, Version
+
+
(obtained from PKESK/SKESK)
(obtained from PKESK/SKESK)
Text is not SVG - cannot display
\ No newline at end of file diff --git a/book/source/drawio/SKESKv4-decryption.drawio b/book/source/drawio/SKESKv4-decryption.drawio index 0a8c28f..d7c71b5 100644 --- a/book/source/drawio/SKESKv4-decryption.drawio +++ b/book/source/drawio/SKESKv4-decryption.drawio @@ -1,34 +1,34 @@ - + - + - + - + - + - + - - + + - + - + - + - + @@ -38,19 +38,19 @@ - + - + - + - + - + @@ -61,53 +61,56 @@ - + - + - + - + - + - - + + + + + + + - + - + - - - - - - - + + - + + + + diff --git a/book/source/drawio/SKESKv4-decryption.svg b/book/source/drawio/SKESKv4-decryption.svg index 879f6bc..c168a78 100644 --- a/book/source/drawio/SKESKv4-decryption.svg +++ b/book/source/drawio/SKESKv4-decryption.svg @@ -1,4 +1,4 @@ -
Passphrase
Passphrase
S2K Function
S2K Function
Session Key
Session Key
Symmetric Key
Symmetric Key
SKESKv4
SKESKv4
Cipher Algo.
Cipher Algo.
S2K Identifier
S2K Identifier
ciphertext
ciphertext
Enc. Session-Key
Enc. Session-Key
yes
yes
key
key
no
no

Is
Encrypted
Session-Key
present
Is...
Symmetric
Decryption
Symmetric...
Text is not SVG - cannot display
\ No newline at end of file +
Passphrase
Passphrase
S2K Function
S2K Function
Session Key
Session Key
Symmetric Key
Symmetric Key
SKESKv4
SKESKv4
Cipher Algo.
Cipher Algo.
S2K Identifier
S2K Identifier
ciphertext
ciphertext
Enc. Session-Key
Enc. Session-Key
yes
yes
key
key
no
no

Is
Encrypted
Session-Key
present
Is...
Symmetric
Decryption
Symmetric...
Cipher Algorithm
+
Session Key
Cipher Algorithm...
Text is not SVG - cannot display
\ No newline at end of file