Skip to content

Commit 41ae7e7

Browse files
committed
revert touching test
1 parent 2e2d824 commit 41ae7e7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

demos/android/MASVS-CRYPTO/MASTG-DEMO-0022/MASTG-DEMO-0022.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ The rule has identified two instances in the code file where insecure encryption
2828

2929
### Evaluation
3030

31-
The test fails due to the use of risky or broken encryption algorithms, specifically DES, 3DES, RC4 and Blowfish.
31+
The test fails due to the use of weak encryption algorithms, specifically DES, 3DES, RC4 and Blowfish.
3232

3333
See @MASTG-TEST-0221 for more information.

demos/android/MASVS-CRYPTO/MASTG-DEMO-0022/MastgTest.kt

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import javax.crypto.SecretKey
1313

1414
class MastgTest(private val context: Context) {
1515

16-
// Vulnerable encryption using DES (broken algorithm)
16+
// Vulnerable encryption using DES (weak algorithm)
1717
fun vulnerableDesEncryption(data: String): String {
1818
try {
1919
// Weak key for DES
@@ -23,7 +23,7 @@ class MastgTest(private val context: Context) {
2323
val keyFactory = SecretKeyFactory.getInstance("DES")
2424
val secretKey: Key = keyFactory.generateSecret(keySpec)
2525

26-
// Broken encryption algorithm (DES)
26+
// Weak encryption algorithm (DES)
2727
val cipher = Cipher.getInstance("DES")
2828
cipher.init(Cipher.ENCRYPT_MODE, secretKey)
2929

@@ -35,7 +35,7 @@ class MastgTest(private val context: Context) {
3535
}
3636

3737

38-
// Risky encryption using 3DES (Triple DES)
38+
// Vulnerable encryption using 3DES (Triple DES)
3939
fun vulnerable3DesEncryption(data: String): String {
4040
try {
4141
val keyBytes = ByteArray(24)
@@ -44,7 +44,7 @@ class MastgTest(private val context: Context) {
4444
val keyFactory = SecretKeyFactory.getInstance("DESede")
4545
val secretKey: Key = keyFactory.generateSecret(keySpec)
4646

47-
// Risky encryption algorithm (3DES)
47+
// Weak encryption algorithm (3DES)
4848
val cipher = Cipher.getInstance("DESede")
4949
cipher.init(Cipher.ENCRYPT_MODE, secretKey)
5050

@@ -72,15 +72,15 @@ class MastgTest(private val context: Context) {
7272
}
7373
}
7474

75-
// Insecure encryption using Blowfish (broken algorithm)
75+
// Insecure encryption using Blowfish (weak algorithm)
7676
fun vulnerableBlowfishEncryption(data: String): String {
7777
return try {
7878
// Weak key for Blowfish (insecure, small key size)
7979
val keyBytes = ByteArray(8) // Only 8 bytes (64-bit key) - not secure
8080
SecureRandom().nextBytes(keyBytes)
8181
val secretKey: SecretKey = SecretKeySpec(keyBytes, "Blowfish")
8282

83-
// Broken encryption algorithm (Blowfish)
83+
// Weak encryption algorithm (Blowfish)
8484
val cipher = Cipher.getInstance("Blowfish")
8585
cipher.init(Cipher.ENCRYPT_MODE, secretKey)
8686

@@ -95,16 +95,16 @@ class MastgTest(private val context: Context) {
9595
fun mastgTest(): String {
9696
val sensitiveString = "Hello from the OWASP MASTG Test app."
9797

98-
// Encrypt with broken DES
98+
// Encrypt with weak DES
9999
val desEncryptedString = vulnerableDesEncryption(sensitiveString)
100100

101-
// Encrypt with risky 3DES
101+
// Encrypt with weak 3DES
102102
val tripleDesEncryptedString = vulnerable3DesEncryption(sensitiveString)
103103

104104
// Encrypt with deprecated RC4
105105
val rc4EncryptedString = vulnerableRc4Encryption(sensitiveString)
106106

107-
// Encrypt with broken Blowfish
107+
// Encrypt with weak Blowfish
108108
val blowfishEncryptedString = vulnerableBlowfishEncryption(sensitiveString)
109109

110110
// Returning the encrypted results

demos/android/MASVS-CRYPTO/MASTG-DEMO-0022/output.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
MastgTest_reversed.java
88
❯❱ rules.weak-encryption-algorithms
9-
[MASVS-CRYPTO-1] Broken encryption algorithms found in use.
9+
[MASVS-CRYPTO-1] Weak encryption algorithms found in use.
1010

1111
39┆ Cipher cipher = Cipher.getInstance("DES");
1212
⋮┆----------------------------------------

0 commit comments

Comments
 (0)