blob: e3ac89f8e8bf839310a60c1d283cc94757a0a0be (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright © 2020 rsiddharth <s@ricketyspace.net>
// SPDX-License-Identifier: ISC
package challenge
import (
"fmt"
"ricketyspace.net/cryptopals/lib"
)
func C3() {
hs := "1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736"
k, ds, scr := lib.XORCrackSingleKey(hs)
fmt.Printf("Key is '%c' (Score: %v)\n", k, scr)
fmt.Printf("Decrypted string: %v\n", ds)
}
// Output:
//
// Key is 'X' (Score: 0.03235294117647047)
// Decrypted string: Cooking MC's like a pound of bacon
|