{"id":13582284,"url":"https://github.com/ffuf/pencode","last_synced_at":"2026-01-02T11:06:56.118Z","repository":{"id":48939093,"uuid":"274425010","full_name":"ffuf/pencode","owner":"ffuf","description":"Complex payload encoder","archived":false,"fork":false,"pushed_at":"2024-01-20T10:49:27.000Z","size":58,"stargazers_count":209,"open_issues_count":0,"forks_count":25,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-05T22:40:33.251Z","etag":null,"topics":["hacktoberfest","http","payload","url-encoder"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ffuf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-23T14:18:25.000Z","updated_at":"2024-10-09T10:33:27.000Z","dependencies_parsed_at":"2023-01-18T20:46:23.014Z","dependency_job_id":"8654feed-8155-4ed3-82ff-6dd0cc08d165","html_url":"https://github.com/ffuf/pencode","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffuf%2Fpencode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffuf%2Fpencode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffuf%2Fpencode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ffuf%2Fpencode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ffuf","download_url":"https://codeload.github.com/ffuf/pencode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495634,"owners_count":20948088,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","http","payload","url-encoder"],"created_at":"2024-08-01T15:02:34.246Z","updated_at":"2026-01-02T11:06:56.112Z","avatar_url":"https://github.com/ffuf.png","language":"Go","readme":"# pencode - complex payload encoder\n\nPencode is a tool that helps you to create payload encoding chains. It has been designed to be used in automation whereever\nit is required to apply multiple encodings to a payload (and possibly inserting the payload to a template in between).\n\n`pencode` can be used as a standalone command line tool or as a library for other Go programs.\n\n\n## Installation\n```\ngo install github.com/ffuf/pencode/cmd/pencode@latest\n```\n\n### Usage\n\n```\npencode - complex payload encoder v0.4\n\nUsage: ./pencode FUNC1 FUNC2 FUNC3...\n\n./pencode reads input from stdin by default, which is typically piped from another process.\n\nOPTIONS:\n-input reads input from a file, line by line.\n\nENCODERS\n  b64encode         - Base64 encoder\n  hexencode         - Hex string encoder\n  htmlescape        - HTML escape\n  jsonescape        - JSON escape\n  unicodeencodeall  - Unicode escape string encode (all characters)\n  urlencode         - URL encode reserved characters\n  urlencodeall      - URL encode all characters\n  utf16             - UTF-16 encoder (Little Endian)\n  utf16be           - UTF-16 encoder (Big Endian)\n  xmlescape         - XML escape\n\nDECODERS\n  b64decode         - Base64 decoder\n  hexdecode         - Hex string decoder\n  htmlunescape      - HTML unescape\n  jsonunescape      - JSON unescape\n  unicodedecode     - Unicode escape string decode\n  urldecode         - URL decode\n  xmlunescape       - XML unescape\n\nHASHES\n  md5               - MD5 sum\n  sha1              - SHA1 checksum\n  sha224            - SHA224 checksum\n  sha256            - SHA256 checksum\n  sha384            - SHA384 checksum\n  sha512            - SHA512 checksum\n\nOTHER\n  filename.tmpl     - Replaces string #PAYLOAD# in content of a file that has .tmpl extension.\n  lower             - Convert string to lowercase\n  upper             - Convert string to uppercase\n\n```\n\nTo urlencode, base64encode and hex encode a string:\n\n```\n$ echo 'what%ever'|pencode urlencode b64encode hexencode\n64326868644355794e5756325a58493d\n```\n\n### Templating\n\nAny command line parameter that is a file path ending with `.tmpl` is considered as a template file by\npencode. It attempts to read the file content and to replace instances of a string `#PAYLOAD#` within the file with\nthe input in the current encoder chain.\n\n### Shell completion\n\nPencode can provide tab completion for available encoders. Bash, Zsh, and Fish are supported.\n\n```\n$ pencode \u003cTAB\u003e\nb64decode         hexdecode         unicodedecode     urldecode         urlencodeall      utf16be\n...\n```\n\nIn order to activate shell completion, you need to inform your shell that completion is available for your script.\n\n#### Bash\n\nTo get auto-complete working you need to `source` the `pencode-completion.bash` file in your `~/.bashrc` or similar:\n\n```\nsource ~/path/to/pencode-completion.bash\n```\n\n#### Zsh\n\nTo get auto-complete working you need to enable autocomplete _(not needed if you have Oh-My-Zsh)_ using `autoload -U compaudit \u0026\u0026 compinit` or by putting it into `~/.zshrc`\n\nThen `source` the `pencode-completion.zsh` file in your `.zshrc` or similar:\n\n```\nsource ~/path/to/pencode-completion.zsh\n```\n\n#### Fish\n\nTo get auto-complete working you need to `source` the `pencode-completion.fish` file to your config folder `~/.config/fish/completions/pencode.fish` or similar:\n\n```\nsource ~/path/to/pencode-completion.fish\n```\n\n### Usage as a library\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \n    \"github.com/ffuf/pencode/pkg/pencode\"\n)\n\nfunc main() {\n    inputdata := \"Whatever you wish to run through the chain\"\n    # A slice of encoders in the preferred encoding chain execution order\n    encoders := []string{\n        \"utf16\",\n        \"b64encode\",\n    }\n    chain := pencode.NewChain()\n    err := chain.Initialize(encoders)\n    if err != nil {\n        panic(err)\n    }\n    output, err := chain.Encode([]byte(inputdata))\n    if err != nil {\n        panic(err)\n    }\n    fmt.Print(string(output))\n}\n```\n\n## License\n\n`pencode` is released under MIT license. See [LICENSE](https://github.com/ffuf/pencode/blob/master/LICENSE).\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffuf%2Fpencode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fffuf%2Fpencode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fffuf%2Fpencode/lists"}