From c1240b472934f0b7649922722fe0d61c0c1c6cac Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 30 Aug 2020 20:15:58 -0400 Subject: challenge: do challenge 5 * challenge/c05.go: Implement challenge 5. * cryptopals.go (main): Add handling to run challenge 5. * lib/hex.go (BytesToHexStr): New function. * lib/xor.go (RepeatingXOR): New function. --- challenge/c05.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 challenge/c05.go (limited to 'challenge') diff --git a/challenge/c05.go b/challenge/c05.go new file mode 100644 index 0000000..7f22663 --- /dev/null +++ b/challenge/c05.go @@ -0,0 +1,21 @@ +// Copyright © 2020 rsiddharth +// SPDX-License-Identifier: ISC + +package challenge + +import ( + "fmt" + "ricketyspace.net/cryptopals/lib" +) + +var icebaby string = `Burning 'em, if you ain't quick and nimble +I go crazy when I hear a cymbal` + +var key string = "ICE" + +func C5() { + es := lib.RepeatingXOR(icebaby, key) + hs := lib.BytesToHexStr([]byte(es)) + + fmt.Printf("RepeatingXOR('%v', '%v') = %v\n", icebaby, key, hs) +} -- cgit v1.2.3