//one reason is whitespace ciphertext = strings.Replace(ciphertext, " ", "", -1) k, err0 := base64.StdEncoding.DecodeString(ciphertext)