Skip to content

Commit 9576e4c

Browse files
update qhelp to include a description for the accompanying example
1 parent 746f535 commit 9576e4c

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

swift/ql/src/queries/Security/ECB-Encryption/ECBEncryption.qhelp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
"-//Semmle//qhelp//EN"
33
"qhelp.dtd">
44
<qhelp>
5-
<overview>
6-
<p>ECB should not be used as a mode for encryption. It has dangerous weaknesses. Data is encrypted the same way every time
7-
meaning the same plaintext input will always produce the same ciphertext. This behaviour makes encrypted messages vulnerable
8-
to replay attacks.</p>
5+
<overview>
6+
<p>ECB should not be used as a mode for encryption. It has dangerous weaknesses. Data is encrypted the same way every time meaning the same plaintext input will always produce the same ciphertext. This behaviour makes encrypted messages vulnerable to replay attacks.</p>
7+
</overview>
98

10-
</overview>
11-
<recommendation>
12-
<p>Use a different cipher mode such as CBC.</p>
9+
<recommendation>
10+
<p>Use a different cipher mode such as CBC.</p>
11+
</recommendation>
1312

14-
</recommendation>
15-
<references>
13+
<example>
14+
<p>The following example shows six cases of instantiating a cipher with various encryption keys and block modes. In the 'BAD' case, the mode of encrtyption is ECB, making the encryped data vulnerable to replay attacks. In the 'GOOD' cases, the encryption mode is CBC, pretecting the encrypted data against replay attacks.</p>
15+
<sample src="ECBEncryption.swift" />
16+
</example>
1617

17-
<li>Wikipedia, block cipher modes of operation, <a href="https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29">Electronic codebook (ECB)</a>.</li>
18-
19-
</references>
18+
<references>
19+
<li>Wikipedia, block cipher modes of operation, <a href="https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29">Electronic codebook (ECB)</a>.</li>
20+
</references>
2021
</qhelp>

0 commit comments

Comments
 (0)