This page looks best with JavaScript enabled

Matasano Crypto Challenges - 1/1 - Solved in Go

· ☕ 1 min read

This is the solution I came up with in Go for Set 1 / Challenge 1 of the
matasano crypto challenges.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
package main

import b64 "encoding/base64"
import hex "encoding/hex"
import "fmt"

func main() {
    data := "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f" +
            "69736f6e6f7573206d757368726f6f6d"

    hexData, _ := hex.DecodeString(data)
    hexEnc := b64.StdEncoding.EncodeToString(hexData)

    fmt.Println(hexEnc)
}

Running this will output the expected result, like so:

1
2
Pu:~ nate$ go run test.go 
SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t
Share on

Nathaniel Michael
WRITTEN BY
Nathaniel Michael
Engineer