Skip to content

Commit

Permalink
minor update demo 14
Browse files Browse the repository at this point in the history
  • Loading branch information
cpholguera committed Aug 19, 2024
1 parent c6dcfa5 commit f684cc1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions demos/ios/MASVS-CRYPTO/MASTG-DEMO-0014/MASTG-DEMO-0014.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
platform: ios
title: Uses of Insecure Algorithms in CCCrypt with r2
title: Uses of Insecure Encryption Algorithms in CommonCrypto with r2
code: [swift]
id: MASTG-DEMO-0014
test: MASTG-TEST-0210
Expand Down Expand Up @@ -82,10 +82,8 @@ enum {
};
```

With this information we can now inspect the disassembled code and we'll see that the 3DES algorithm can be found by its numeric value `2` in the second argument of the `CCCrypt` function (`w1`):
With this information we can now inspect the disassembled code and we'll see that the 3DES algorithm (`kCCAlgorithm3DES`) can be found by its numeric value `2` in the second argument of the `CCCrypt` function (`w1`). The `CCCrypt` function is called with a padding option of PKCS7, no initialization vector, and a key of 24 bytes:

{{ evaluation.txt }}

This call to `CCCrypt` is encrypting data using the 3DES algorithm with a padding option of PKCS7, no initialization vector, and a key of 24 bytes.

In this case, the algorithm used is `kCCAlgorithm3DES`, which is considered insecure and should be replaced with a more secure algorithm such as `kCCAlgorithmAES128`.
The test fails because the 3DES encryption algorithm was found in the code.

0 comments on commit f684cc1

Please sign in to comment.