Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vacekj/keycheck
Don't leak your keys.
https://github.com/vacekj/keycheck
Last synced: about 2 months ago
JSON representation
Don't leak your keys.
- Host: GitHub
- URL: https://github.com/vacekj/keycheck
- Owner: vacekj
- License: mit
- Created: 2023-04-25T22:32:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-29T19:42:23.000Z (8 months ago)
- Last Synced: 2024-09-09T16:05:23.989Z (4 months ago)
- Language: Rust
- Homepage: https://crates.io/crates/keycheck
- Size: 16.6 KB
- Stars: 14
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Keycheck
Checks your repository for Ethereum private keys in the hexadecimal format. Meant to be used in a pre-commit hook.## Installation
```shell
cargo install keycheck
```## Usage
### Manual
Check the current folder and all subfolders for private keys. Respects your `.gitignore`
Upon finding a private key, outputs the file and line number, but not the key itself.
Exit code 0 for no keys, 1 for key(s) found.```shell
keycheck
```### In a git pre-commit hook
```shell
brew install lefthookecho 'pre-commit:
commands:
keycheck:
run: keycheck' > lefthook.yml
lefthook install
```### Ignoring files
keycheck respects a `.keycheckignore` file. Format is the same as `.gitignore`, so globs, comments etc. work as expected.## Performance
on `OpenZeppelin/openzeppelin-contracts` repo:
```shell
$ hyperfine keycheck -i --warmup 5
Benchmark 1: keycheck
Time (mean ± σ): 13.1 ms ± 0.5 ms [User: 3.6 ms, System: 15.9 ms]
Range (min … max): 12.4 ms … 15.2 ms 183 runs
```
[priv-key-precommit](https://github.com/Dhaiwat10/priv-key-precommit)```shell
hyperfine priv-key-precommit --warmup 5
Benchmark 1: priv-key-precommit
Time (mean ± σ): 1.651 s ± 0.047 s [User: 1.625 s, System: 0.217 s]
Range (min … max): 1.599 s … 1.746 s 10 runs
```````keycheck` is 126x times faster, or a 99.2% performance improvement.
# License
MIT