Tags: reverse golang 

Rating: 5.0

The algorithm is 100% reversable. Here's the code to solve it:
```
package main

import (
"encoding/hex"
"fmt"
"strings"
)

func charCodeAt(st string, ni int) rune {
for i, j := range st {
if i == ni {
return j
}
}
return 0
}

func hexify(st string) string {
var ok string = ""
ltr := []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}

for cnt := 0; cnt < len(st); cnt++ {
ok += ltr[charCodeAt(st, cnt)>>4] + ltr[charCodeAt(st, cnt)&15]
}

return ok
}

func encrypt(st string) string {

var initialize int = 0
var ot string = ""
var val int

for i := 0; i < len(st); i++ {
val = int(charCodeAt(st, i))
initialize ^= (val << 2) ^ val
ot += string(initialize & 0xff)
initialize >>= 8
}

return strings.Replace(hexify(ot), "00", "", -1)
}

func decrypt(st string) string {

var bst, err = hex.DecodeString(st)
if err != nil { return "-" }
var initialize int = 0
var ot string = ""
var val int

for i := 0; i < len(bst); i++ {
val = decryptInt(int(initialize ^ int(bst[i])))
initialize ^= (val << 2) ^ val
ot += string(val)
initialize >>= 8
}

return ot
}

func decryptInt(n int) int {
var n1 = n & 3
var n2 = ((n >> 2) & 3) ^ n1
var n3 = ((n >> 4) & 3) ^ n2
var n4 = ((n >> 6) & 3) ^ n3
return (n4 << 6) | (n3 << 4) | (n2 << 2) | n1
}

func main() {
//fmt.Println(decryptInt(234))
//fmt.Println(encrypt("batpwn{123456}"))
fmt.Println(decrypt("eae4a5b1aad7964ec9f1f0bff0229cf1a11b22b11bfefecc9922aaf4bff0dd3c88"))
}

//Hash: eae4a5b1aad7964ec9f1f0bff0229cf1a11b22b11bfefecc9922aaf4bff0dd3c88
```
Flag: `batpwn{Ch00se_y0uR_pR3fix_w1selY}`