Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v0.4.1-dev; 2026-08-22
```
complete rewrite of codebase
add OpenCL GPU acceleration for yescrypt / gost-yescrypt with CPU fallback
add ETA status for -w wordlists
```
### v0.3.1; 2026-08-08
```
add gost-yescrypt support
Expand Down
87 changes: 56 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,94 @@
[![GitHub release](https://img.shields.io/github/release/cyclone-github/yescrypt_crack.svg)](https://github.com/cyclone-github/yescrypt_crack/releases)
[![Go Reference](https://pkg.go.dev/badge/github.com/cyclone-github/yescrypt_crack.svg)](https://pkg.go.dev/github.com/cyclone-github/yescrypt_crack)

### Note: v0.4.0-dev adds beta support for OpenCL GPU acceleration.

```
./yescrypt_crack.bin -h hash.txt -w wordlist.txt

--------------------------------------------------
| Cyclone's Yescrypt Cracker |
| https://github.com/cyclone-github/yescrypt_crack |
--------------------------------------------------

Hash file: hash.txt
Total Hashes: 2
CPU Threads: 16
Total Hashes: 26
CPU Threads: 56
Wordlist: wordlist.txt
2026/08/08 11:04:49 Working...
$y$j9T$z7lNWyBfW4ZruGHCsFzDz/$Sz1GtrDDnsf0KfUE8mQHNJqGyG32TDWC287DdU97dz.:cyclone123
$gy$j9T$zHbAdM1G1TomuQ6P6lRwc.$kTKZeBwUiSlCcxHfPQuzczMUxeNgp0LaK2LbsAK8KO/:cyclone123
2026/08/08 11:04:49 Finished
2026/08/08 11:04:49 Cracked: 2/2 23.51 h/s 00h:00m:00s
Backend: auto
GPU selection: all
GPU batch: 1280
2026/08/20 11:54:25 Counting wordlist lines...
2026/08/20 11:54:25 Tuning GPU...
2026/08/20 11:54:26 OpenCL GPU 0: NVIDIA GeForce RTX 4090, 23.5 GiB VRAM, batch cap 1280, self-test passed
2026/08/20 11:54:26 OpenCL GPU 1: NVIDIA GeForce RTX 4090, 23.5 GiB VRAM, batch cap 1280, self-test passed
2026/08/20 11:54:26 Working...
2026/08/20 11:55:26 Cracked: 0/26 7338.51 H/s 01m:00s/--
2026/08/20 11:56:26 Cracked: 0/26 7391.90 H/s 02m:00s/--
2026/08/20 11:57:26 Cracked: 0/26 7416.85 H/s 03m/1d:17h:06m
2026/08/20 11:58:26 Cracked: 0/26 7434.64 H/s 04m/1d:20h:21m
2026/08/20 11:59:26 Cracked: 0/26 7441.04 H/s 05m/1d:13h:26m
````
### Install this dev branch:
```

### Install from latest:
go install github.com/cyclone-github/yescrypt_crack@yescrypt_crack_gpu
```
### Install latest main branch:
```
go install github.com/cyclone-github/yescrypt_crack@main
```

### Info:
I wrote this tool since yescrypt has become the default /etc/shadow hash for many popular linux distros such as Debian, Ubuntu, RHEL, Fedora, Arch, etc, and due to the very limited hash cracking tools that supported yescrypt.

Supports both yescrypt and gost-yescrypt.

Since `yescrypt_crack` is written in pure Go, it easily compiles and runs on just about any OS and architecture such as Intel/ARM, Linux, Windows, Mac.
I originally wrote this tool in 2025 since yescrypt had become the default /etc/shadow hash for many popular Linux distros such as Debian, Ubuntu, RHEL, Fedora, Arch, etc, and due to the very limited hash cracking tools that supported yescrypt at that time.

It is worth noting that JtR can be faster than `yescrypt_crack`, so YMMV.
`yescrypt_crack` supports OpenCL GPU acceleration for yescrypt and gost-yescrypt. GPU mode is used by default when a supported OpenCL GPU is available, and CPU mode is avaialble by using flag `-cpu`. All R&D has been performed on Debian 12/13 Linux. Cross platform support for Windows has been implemented, but is not guaranteed. For best results, Linux is recommended. Mac is not supported from v0.4.0 onward, but is supported on v0.3.1.

### Example hash:plain:
```
$y$j9T$z7lNWyBfW4ZruGHCsFzDz/$Sz1GtrDDnsf0KfUE8mQHNJqGyG32TDWC287DdU97dz.:cyclone123
$gy$j9T$Mq.X1lTWvTD74i0lyu6lC0$11n1S4OQtGaonRa4j4y9FsY.DnZUDwBFGKyzH2J/ry.:cyclone123
$y$j9T$ss392e/1r/sS364AbKyZU1$Z6lrn5PE2YqIDbgeH590BnPC5fP8BFrkRgOhvo8WKVC:yescrypt_crack
$gy$j9T$pFEYYB6sbVC37XBX.uMqK/$xY/CaU3ESVzvfR9YErup5kUn2FiHSOoqgAx1zUA99u1:yescrypt_crack
```

### Supported options:
```
-w {wordlist} (omit -w to read from stdin)
-h {yescrypt_hash}
-h {yescrypt_hash_file}
-o {output} (omit -o to write to stdout)
-t {cpu threads}
-t {cpu threads} (selects CPU mode)
-s {print status every nth sec}
-gpu [all|0,1|list] (default: all GPUs; omit value to use all GPUs)
-cpu (force CPU mode)
-b {gpu batch size} (optional; 0 = auto)

-version (version info)
-help (usage instructions)
```

### Examples:
```
./yescrypt_crack.bin -h hashes.txt -w wordlist.txt -o found.txt

./yescrypt_crack.bin -h {yescrypt_hash} -w {wordlist} -o {output} -t {cpu threads} -s {print status every nth sec}
./yescrypt_crack.bin -h hashes.txt -w wordlist.txt -gpu

./yescrypt_crack.bin -h yescrypt.txt -w wordlist.txt -o cracked.txt -t 16 -s 10
./yescrypt_crack.bin -h hashes.txt -w wordlist.txt -gpu 0,1

cat wordlist | ./yescrypt_crack.bin -h yescrypt.txt
./yescrypt_crack.bin -h hashes.txt -w wordlist.txt -gpu 0,1 -b 1280 -s 10

./yescrypt_crack.bin -h yescrypt.txt -w wordlist.txt -o output.txt
./yescrypt_crack.bin -h hashes.txt -w wordlist.txt -cpu -t 16 -s 10

cat wordlist | ./yescrypt_crack.bin -h hashes.txt

./yescrypt_crack.bin -gpu list
```

For backwards compatibility, explicitly specifying `-cpu` selects CPU mode.

### Credits:
* `yescrypt_crack` tool was written by cyclone in pure Go
* `yescrypt_crack` uses Solar Designer's yescrypt-go implementation: https://github.com/openwall/yescrypt-go
* The yescrypt algo was written by Solar Designer: https://www.openwall.com/yescrypt/
* `yescrypt_crack` was written by cyclone in Go
* The yescrypt algorithm was designed by Solar Designer: https://www.openwall.com/yescrypt/
* The CPU yescrypt implementation in `yescrypt_cpu.go` is adapted from `openwall/yescrypt-go`: https://github.com/openwall/yescrypt-go
* The GPU implementation in `yescrypt.cl` is adapted from hashcat's yescrypt OpenCL implementation: https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_hash_yescrypt.cl
* Streebog-256 is provided by `github.com/tarantool/go-gostcrypto/streebog`.
* See `THIRD_PARTY_NOTICES.md` for upstream copyright notices and license terms.

### Changelog:
- https://github.com/cyclone-github/yescrypt_crack/blob/main/CHANGELOG.md
Expand All @@ -77,9 +102,9 @@ cat wordlist | ./yescrypt_crack.bin -h yescrypt.txt
- This assumes you have Go and Git installed
- `git clone https://github.com/cyclone-github/yescrypt_crack.git` # clone repo
- `cd yescrypt_crack` # enter project directory
- `go mod tidy` # download dependencies
- `go build -ldflags="-s -w" .` # compile binary in current directory
- `go install -ldflags="-s -w" .` # compile binary and install to $GOPATH
- `./yescrypt_crack -h {hash file} -w {wordlist file} -t {CPU threads to use (optional)}` # run yescrypt_crack
- `go mod tidy` # download dependencies
- `go build -ldflags="-s -w" .` # compile binary in current directory
- `go install -ldflags="-s -w" .` # compile binary and install to $GOPATH
- `./yescrypt_crack -h {hash file} -w {wordlist file}` # run yescrypt_crack
- Compile from source code how-to:
- https://github.com/cyclone-github/scripts/blob/main/intro_to_go.txt
69 changes: 69 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Third-Party Notices

`yescrypt_crack` is licensed under GPLv2. The project also contains or depends on work from the projects below.

## yescrypt / yescrypt-go

yescrypt was designed by Solar Designer. Portions of the CPU implementation in `yescrypt_cpu.go` are adapted from `openwall/yescrypt-go`.

Project: https://github.com/openwall/yescrypt-go

License: BSD-3-Clause

Copyright (c) 2009-2020 The Go Authors. All rights reserved.
Copyright (c) 2024 Solar Designer. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## hashcat

The GPU implementation in yescrypt.cl is adapted from hashcat's yescrypt OpenCL implementation.

Relevant implementation: https://github.com/hashcat/hashcat/blob/master/OpenCL/inc_hash_yescrypt.cl

License: MIT

Copyright (c) 2015-2025 Jens Steube

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

## go-gostcrypto

The gost-yescrypt finalization path imports `github.com/tarantool/go-gostcrypto/streebog`.

Project: https://github.com/tarantool/go-gostcrypto

License: BSD-2-Clause

Copyright (c) 2026, Tarantool AUTHORS

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion check_hex.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func checkForHexBytes(line []byte) ([]byte, []byte, int) {
}

decodedBytes = make([]byte, hex.DecodedLen(len(cleaned)))
_, err = hex.Decode(decodedBytes, cleaned)
n, err = hex.Decode(decodedBytes, cleaned)
if err != nil {
return line, line, 1
}
Expand Down
7 changes: 1 addition & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,4 @@ module github.com/cyclone-github/yescrypt_crack

go 1.26.2

require (
github.com/openwall/yescrypt-go v1.0.0
github.com/tarantool/go-gostcrypto v0.1.0
)

require golang.org/x/crypto v0.55.0 // indirect
require github.com/tarantool/go-gostcrypto v0.1.0
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
github.com/openwall/yescrypt-go v1.0.0 h1:jsGk48zkFvtUjGVOhYPGh+CS595JmTRcKnpggK2AON4=
github.com/openwall/yescrypt-go v1.0.0/go.mod h1:e6CWtFizUEOUttaOjeVMiv1lJaJie3mfOtLJ9CCD6sA=
github.com/tarantool/go-gostcrypto v0.1.0 h1:sGjZil1nfXzxvBU4TOIZErTXcvCuCLH/pZnwfXr9uaY=
github.com/tarantool/go-gostcrypto v0.1.0/go.mod h1:oieRliQHLNWjZ5qrpIamIFNHJ3j7dEvU4evBr6HeEFc=
golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
84 changes: 21 additions & 63 deletions gost.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package main

import (
"bytes"
"crypto/hmac"

"github.com/openwall/yescrypt-go"
"github.com/tarantool/go-gostcrypto/streebog"
)

var cryptBase64DecodeTable = [...]byte{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
64, 64, 64, 64, 64, 64, 64,
Expand All @@ -18,6 +10,8 @@ var cryptBase64DecodeTable = [...]byte{
51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
}

const cryptBase64Alphabet = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"

func cryptBase64Value(c byte) int {
if c >= '.' && c <= 'z' {
return int(cryptBase64DecodeTable[c-'.'])
Expand All @@ -29,11 +23,9 @@ func cryptBase64Value(c byte) int {
// by yescrypt and gost-yescrypt. It is not RFC 4648 base64.
func decodeCryptBase64(src []byte) []byte {
dst := make([]byte, 0, len(src)*3/4)

for i := 0; i < len(src); {
var value uint32
var bits uint32

for ; bits < 24 && i < len(src); bits += 6 {
c := cryptBase64Value(src[i])
if c > 63 {
Expand All @@ -42,73 +34,39 @@ func decodeCryptBase64(src []byte) []byte {
i++
value |= uint32(c) << bits
}

if bits < 12 {
return nil
}

for ; bits >= 8; bits -= 8 {
dst = append(dst, byte(value))
value >>= 8
}

if value != 0 {
return nil
}
}

return dst
}

func crackGostYescrypt(password, fullHash []byte) bool {
if !bytes.HasPrefix(fullHash, []byte("$gy$")) {
return false
}

// libxcrypt computes the normal yescrypt result first using the same
// parameters and salt. Convert "$gy$..." to "$y$..." for yescrypt-go.
yescryptSetting := make([]byte, 0, len(fullHash)-1)
yescryptSetting = append(yescryptSetting, '$', 'y', '$')
yescryptSetting = append(yescryptSetting, fullHash[4:]...)

yescryptHash, err := yescrypt.Hash(password, yescryptSetting)
if err != nil {
return false
}

yescryptDigestPos := bytes.LastIndexByte(yescryptHash, '$')
if yescryptDigestPos < 0 {
return false
}
yescryptDigest := decodeCryptBase64(yescryptHash[yescryptDigestPos+1:])
if len(yescryptDigest) != 32 {
return false
}

// the final '$' separates the gost-yescrypt setting from its digest
// libxcrypt intentionally excludes this '$' from the inner HMAC message
gostDigestPos := bytes.LastIndexByte(fullHash, '$')
if gostDigestPos < 0 {
return false
}
expectedDigest := decodeCryptBase64(fullHash[gostDigestPos+1:])
if len(expectedDigest) != 32 {
return false
func encodeCryptBase64(src []byte) []byte {
dst := make([]byte, 0, (len(src)*8+5)/6)
for i := 0; i < len(src); {
var value uint32
bits := 0
for bits < 24 && i < len(src) {
value |= uint32(src[i]) << bits
i++
bits += 8
}
for bits > 0 {
dst = append(dst, cryptBase64Alphabet[value&0x3f])
value >>= 6
bits -= 6
}
}
return dst
}

// libxcrypt construction:
// hk = Streebog-256(password)
// interm = HMAC-Streebog-256(hk, gost setting without trailing '$')
// result = HMAC-Streebog-256(interm, raw yescrypt 256-bit result)
hk := streebog.Sum256(password)

mac := hmac.New(streebog.New256, hk[:])
_, _ = mac.Write(fullHash[:gostDigestPos])
interm := mac.Sum(nil)

mac = hmac.New(streebog.New256, interm)
_, _ = mac.Write(yescryptDigest)
generatedDigest := mac.Sum(nil)

return hmac.Equal(expectedDigest, generatedDigest)
func crackGostYescrypt(password, fullHash []byte) bool {
return crackHash(password, fullHash)
}
Loading
Loading