Challenge 17 - Decode the Secret

👋 Welcome Gophers! In this challenge, you are tasked with decoding the secret message.

You will need to implement the DecodeSecret function which will take in a string that has been encoded using base64 encoding and decode this string.

This decoded string will be the result of a caesar cipher which has shifted all of the characters of the string up by 1 place. So you will have to ensure that when you return the result, it also decodes this cipher.

View Solution
package main

import (

func DecodeSecret(message string) string {
	data, err := base64.StdEncoding.DecodeString(message)
	if err != nil {

	var secret []rune
	for _, char := range data {
		fmt.Println(rune(char + 1))
		secret = append(secret, rune(char-1))


	return string(secret)

func main() {
	fmt.Println("Decode the Secret")

	message := "VEZEU0ZVVFVTSk9I"
	result := DecodeSecret(message)


Further Reading:

If you enjoyed this challenge, you may also enjoy some of the other challenges on this site:

Other Challenges