diff --git a/testutils/g407_samples.go b/testutils/g407_samples.go index 85054bb..461fa7c 100644 --- a/testutils/g407_samples.go +++ b/testutils/g407_samples.go @@ -31,6 +31,29 @@ import ( "fmt" ) +func encrypt(nonce []byte) { + block, _ := aes.NewCipher([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) + aesOFB := cipher.NewOFB(block, nonce) + var output = make([]byte, 16) + aesOFB.XORKeyStream(output, []byte("Very Cool thing!")) + fmt.Println(string(output)) +} + +func main() { + + var nonce = []byte("ILoveMyNonceAlot") + encrypt(nonce) +} +`}, 1, gosec.NewConfig()}, + + {[]string{`package main + +import ( + "crypto/aes" + "crypto/cipher" + "fmt" +) + func main() { block, _ := aes.NewCipher([]byte{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1})