Base64

Base64 is used to represent binary data in an ASCII string. This is a simple encoding and commonly found into malware.

Code Snippets

package main

import (
    "encoding/base64"
    "fmt"
    "os"
)

func main() {

    arg1 := os.Args[1]

    encoded := base64.StdEncoding.EncodeToString([]byte(arg1))
    fmt.Println(encoded)

    decoded, err := base64.StdEncoding.DecodeString(encoded)
    if err != nil {
        panic("error")
    }
    fmt.Println(string(decoded))
}

Additional Resources

Subscribe to our Newsletter and don't miss important updates