summaryrefslogtreecommitdiffstats
path: root/challenge/c14.go
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2021-02-24 17:13:22 -0500
committerrsiddharth <s@ricketyspace.net>2021-02-24 17:13:22 -0500
commit197b57adb377ea8b8fffaf076f6797abdf8c3fe5 (patch)
tree2579cae6ad292d73b0d8b635a7a43eac5f7a79ae /challenge/c14.go
parenteec7f9ae3fcb4a9eecf1bd5aa3d58cb66544643e (diff)
challenge/c12.go: refactor
Keep everything inside C12
Diffstat (limited to 'challenge/c14.go')
-rw-r--r--challenge/c14.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge/c14.go b/challenge/c14.go
index 3b5b11c..4471f44 100644
--- a/challenge/c14.go
+++ b/challenge/c14.go
@@ -5,9 +5,12 @@ package challenge
import (
"fmt"
+
"ricketyspace.net/cryptopals/lib"
)
+var sheep byte = 65
+
func C14() {
blocksize := findBlockSizeForVarEncryptECB()
rpl, nrpb, rpo := findRandPrefixLen(blocksize)
@@ -32,6 +35,14 @@ func C14() {
fmt.Printf("Unknown String:\n%v", lib.BytesToStr(ds))
}
+func freshSheepBytes(n int) []byte {
+ in := make([]byte, n)
+ for i := 0; i < n; i++ {
+ in[i] = sheep
+ }
+ return in
+}
+
func findBlockSizeForVarEncryptECB() int {
in := make([]byte, 0)