A non-parallelizable proof of work challenge system
To download, cache, and execute a binary to solve a PoW challenge in a single command, use:
curl -sSfL https://pwn.red/pow | sh -s challenge
Static binaries for Linux, Windows, and macOS are also available in GitHub releases.
If Go and libgmp are available, you can compile, install, and run with:
go install github.com/redpwn/pow/cmd/redpwnpow@latest
redpwnpow challenge
redpwnpow can be used as a drop-in replacement for kCTF's proof of work solver.
package main
import (
"bufio"
"fmt"
"os"
"github.com/redpwn/pow"
)
func main() {
c := pow.GenerateChallenge(5000)
fmt.Printf("proof of work: curl -sSfL https://pwn.red/pow | sh -s %s\nsolution: ", c)
s, _ := bufio.NewReader(os.Stdin).ReadString('\n')
if good, err := c.Check(s); err == nil && good {
fmt.Println("good")
} else {
fmt.Println("bad")
}
}