@ -28,8 +28,8 @@ order to:
* Replace as many useful identifiers as possible with short base64 hashes
* Replace as many useful identifiers as possible with short base64 hashes
* Replace package paths with short base64 hashes
* Replace package paths with short base64 hashes
* Replace filenames and position information with short base64 hashes
* Remove all [build ](https://go.dev/pkg/runtime/#Version ) and [module ](https://go.dev/pkg/runtime/debug/#ReadBuildInfo ) information
* Remove all [build ](https://go.dev/pkg/runtime/#Version ) and [module ](https://go.dev/pkg/runtime/debug/#ReadBuildInfo ) information
* Strip filenames and shuffle position information
* Strip debugging information and symbol tables via `-ldflags="-w -s"`
* Strip debugging information and symbol tables via `-ldflags="-w -s"`
* [Obfuscate literals ](#literal-obfuscation ), if the `-literals` flag is given
* [Obfuscate literals ](#literal-obfuscation ), if the `-literals` flag is given
* Remove [extra information ](#tiny-mode ), if the `-tiny` flag is given
* Remove [extra information ](#tiny-mode ), if the `-tiny` flag is given
@ -54,19 +54,19 @@ $ PATH=$(go1.17.1 env GOROOT)/bin:${PATH} garble build
### Literal obfuscation
### Literal obfuscation
Using the `-literals` flag causes literal expressions such as strings to be
Using the `-literals` flag causes literal expressions such as strings to be
replaced with more complex variant s, resolving to the same value at run-time.
replaced with more complex expression s, resolving to the same value at run-time.
This feature is opt-in, as it can cause slow-downs depending on the input code.
This feature is opt-in, as it can cause slow-downs depending on the input code.
Literal expressions used as constant s cannot be obfuscated, since they are
Literals used in constant expression s cannot be obfuscated, since they are
resolved at compile time. This includes any expressions part of a `const`
resolved at compile time. This includes any expressions part of a `const`
declaration.
declaration, for example .
### Tiny mode
### Tiny mode
When the `-tiny` flag is passed, extra information is stripped from the resulting
With the `-tiny` flag, even more information is stripped from the Go binary.
Go binary. This includes line numbers, filenames, and code in the runtime that
Position information is removed entirely, rather than being obfuscated.
prints panics, fatal errors, and trace/debug info. All in all this can make binaries
Runtime code which prints panics, fatal errors, and trace/debug info is removed.
2-5% smaller in our testing, as well as prevent extracting some more information .
All in all, this can make binaries 2-5% smaller .
With this flag, no panics or fatal runtime errors will ever be printed, but they
With this flag, no panics or fatal runtime errors will ever be printed, but they
can still be handled internally with `recover` as normal. In addition, the
can still be handled internally with `recover` as normal. In addition, the