Skip to content

Commit

Permalink
Merge branch 'release/0.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Jan 24, 2022
2 parents 8e293a1 + 9cf91f8 commit 1e40069
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 18 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Changelog

## [0.0.3]

- Update core modules
- Set default cores to all available minus 1


## [0.0.2]

- Show duration estimate for weeks, months and years


## [0.0.1]

- First release
- First release
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ VERSION ?= `[ -d ".git" ] && git describe --tags || echo "0.0.0"`
LDFLAGS=-ldflags "-s -w -X main.appVersion=${VERSION}"
BINARY="wireguard-vanity-keygen"

build = echo "\n\nBuilding $(1)-$(2)" && GOOS=$(1) GOARCH=$(2) go build ${LDFLAGS} -o dist/${BINARY}_${VERSION}_$(1)_$(2) \
build = echo "\n\nBuilding $(1)-$(2)" && GO386=softfloat GOOS=$(1) GOARCH=$(2) go build ${LDFLAGS} -o dist/${BINARY}_${VERSION}_$(1)_$(2) \
&& bzip2 dist/${BINARY}_${VERSION}_$(1)_$(2) \
&& if [ $(1) = "windows" ]; then mv dist/${BINARY}_${VERSION}_$(1)_$(2).bz2 dist/${BINARY}_${VERSION}_$(1)_$(2).exe.bz2; fi

Expand All @@ -21,7 +21,7 @@ release:
$(call build,linux,386)
$(call build,linux,arm)
$(call build,linux,arm64)
$(call build,darwin,arm64)
$(call build,darwin,amd64)
$(call build,darwin,386)
$(call build,windows,386)
$(call build,windows,amd64)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A command-line vanity (public) key generator for [WireGuard](https://www.wiregua
- Optional case sensitive searching
- Search multiple prefixes at once
- Exit after results limit reached (defaults to 1)
- Displays probablibilty and estimated runtime based on quick benchmark
- Displays probability and estimated runtime based on quick benchmark


## Usage options
Expand All @@ -22,7 +22,7 @@ Usage: wireguard-vanity-keygen [OPTIONS] <SEARCH> [<SEARCH>...]
Options:
-c, --case-sensitive case sensitive match (default false)
-t, --threads int threads (default 4)
-t, --threads int threads (defaults to all available cores minus 1)
-l, --limit int limit results to n (exists after) (default 1)
```

Expand Down Expand Up @@ -51,7 +51,7 @@ private 8IdcNsman/ZRGvqWzw1e5cRfhhdtAAmk02X9TkQxhHI= public pC1/N8coOcXmcwO09Q
## Installing

Download the [latest binary release](https://github.com/axllent/wireguard-vanity-keygen/releases/latest) for your system,
or build from source `go get -u github.com/axllent/wireguard-vanity-keygen`(go >= 1.11 required)
or build from source `go install github.com/axllent/wireguard-vanity-keygen`.


## FAQ
Expand All @@ -68,9 +68,9 @@ With case-insensitive searches (default), a-z have the chance of matching both u

### How accurate are the estimated times?

They are not and cannot be accurate. Keys are completely randomly generated, and the estimate is based on a law of averages. For instance, you could find a match for a one in a billion chance on the very first hit, or it could take you 5 billion attempts. It will however give you an indication based on word count, case sensitivity, and use of numbers or characters.
They are not (and cannot be) accurate. Keys are completely randomly generated, and the estimate is based on a law of averages. For instance, you could find a match for a one in a billion chance on the very first hit, or it could take you 5 billion attempts. It will however give you an indication based on your CPU speed, word count, case sensitivity, and use of numbers or characters.


### Why do I need this?

You don't. I wrote it because I run a WireGuard server, which does not provide any reference as to who the key belongs to (`wg` on the server). Using vanity keys, I can at least identify connections. I also wanted to learn more about multi-coe processing in Golang.
You don't. I wrote it because I run a WireGuard server, which does not provide any reference as to who the key belongs to (`wg` on the server). Using vanity keys, I can at least identify connections. I also wanted to learn more about multi-core processing in Golang.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/axllent/wireguard-vanity-keygen

go 1.14
go 1.17

require (
github.com/spf13/pflag v1.0.5
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce
)
16 changes: 9 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71 h1:DOmugCavvUtnUD114C1Wh+UgTgQZ4pMLzXxi1pSt+/Y=
golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce h1:Roh6XWxHFKrPgC/EQhVubSAGQ6Ozk6IdxHSzt1mR0EI=
golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ func main() {
var userCores int

flag := pflag.NewFlagSet(os.Args[0], pflag.ExitOnError)
cores := runtime.NumCPU()
// detect number of cores minus one
cores := runtime.NumCPU() - 1
if cores == 0 {
// if it is single-code then it
cores = 1
}

// set the default help
flag.Usage = func() {
Expand Down

0 comments on commit 1e40069

Please sign in to comment.