This repository was archived by the owner on Jan 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-26
lines changed
ql/test/experimental/CWE-327 Expand file tree Collapse file tree 1 file changed +26
-26
lines changed Original file line number Diff line number Diff line change 1
- package main
2
-
3
- import (
4
- "crypto/des"
5
- "crypto/md5"
6
- "fmt"
7
- )
8
-
9
- func main () {
10
-
11
- password := []byte ("password" )
12
-
13
- var tripleDESKey []byte
14
- tripleDESKey = append (tripleDESKey , password [:16 ]... )
15
- tripleDESKey = append (tripleDESKey , password [:8 ]... )
16
-
17
- // BAD, des is a weak crypto algorithm
18
- _ , err := des .NewTripleDESCipher (tripleDESKey )
19
- if err != nil {
20
- panic (err )
21
- }
22
-
23
- // BAD, md5 is a weak crypto algorithm
24
- fmt .Printf ("%x" , md5 .Sum (password ))
25
-
26
- }
1
+ package main
2
+
3
+ import (
4
+ "crypto/des"
5
+ "crypto/md5"
6
+ "fmt"
7
+ )
8
+
9
+ func main () {
10
+
11
+ password := []byte ("password" )
12
+
13
+ var tripleDESKey []byte
14
+ tripleDESKey = append (tripleDESKey , password [:16 ]... )
15
+ tripleDESKey = append (tripleDESKey , password [:8 ]... )
16
+
17
+ // BAD, des is a weak crypto algorithm
18
+ _ , err := des .NewTripleDESCipher (tripleDESKey )
19
+ if err != nil {
20
+ panic (err )
21
+ }
22
+
23
+ // BAD, md5 is a weak crypto algorithm
24
+ fmt .Printf ("%x" , md5 .Sum (password ))
25
+
26
+ }
You can’t perform that action at this time.
0 commit comments