Skip to content

Commit

Permalink
exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
bodrovis committed Jul 1, 2024
1 parent 8895928 commit 449fcd5
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 48 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ upx:
compress: best
lzma: true
brute: true
goos: [linux, darwin, windows]

archives:
- format: tar.gz
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> Bravely generate key pairs, sign files, and check signatures.
This program, written in Go, contains a collection of tools to generate key pairs in PEM files, sign files, and verify signatures.
This program, written in Go, contains a collection of tools to generate key pairs in PEM files, sign files, and verify signatures using [ed25519](https://ed25519.cr.yp.to/).

**[Find MD documentation in the /docs folder](./docs/brave_signer.md)**

Expand All @@ -14,7 +14,6 @@ Run it:
brave_signer COMMAND FLAGS
```


Available commands (check documentation to learn about all supported settings):

* `keys generate [--pub-key-path pub_key.pem] [--priv-key-path priv_key.pem]` — generate an Ed25519 key pair and store it in PEM files. The private key will be encrypted using a passphrase that you'll need to enter. AES encryption with Argon2 key derivation function is utilized.
Expand Down
13 changes: 10 additions & 3 deletions docs/brave_signer.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
## brave_signer

Bravely generate key pairs, sign files, and check signatures.
Bravely generate key pairs, sign files, and verify signatures.

### Synopsis

A collection of tools to generate key pairs in PEM files, sign files, and verify signatures.
brave_signer is a comprehensive toolset for cryptographic operations, including generating Ed25519 key pairs, signing files, and verifying signatures.

Features:
- Generate secure Ed25519 key pairs and store them in PEM files.
- Encrypt private keys using AES with Argon2 key derivation.
- Sign files and create .sig files containing the signature and signer information.
- Verify file signatures to ensure authenticity and integrity.


### Options

Expand All @@ -22,4 +29,4 @@ A collection of tools to generate key pairs in PEM files, sign files, and verify
* [brave_signer signatures](brave_signer_signatures.md) - Create and verify signatures.
* [brave_signer version](brave_signer_version.md) - Print the version number of brave_signer

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
4 changes: 2 additions & 2 deletions docs/brave_signer_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ See each sub-command's help for details on how to use the generated script.

### SEE ALSO

* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and check signatures.
* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and verify signatures.
* [brave_signer completion bash](brave_signer_completion_bash.md) - Generate the autocompletion script for bash
* [brave_signer completion fish](brave_signer_completion_fish.md) - Generate the autocompletion script for fish
* [brave_signer completion powershell](brave_signer_completion_powershell.md) - Generate the autocompletion script for powershell
* [brave_signer completion zsh](brave_signer_completion_zsh.md) - Generate the autocompletion script for zsh

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
2 changes: 1 addition & 1 deletion docs/brave_signer_completion_bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ brave_signer completion bash

* [brave_signer completion](brave_signer_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
2 changes: 1 addition & 1 deletion docs/brave_signer_completion_fish.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ brave_signer completion fish [flags]

* [brave_signer completion](brave_signer_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
2 changes: 1 addition & 1 deletion docs/brave_signer_completion_powershell.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ brave_signer completion powershell [flags]

* [brave_signer completion](brave_signer_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
2 changes: 1 addition & 1 deletion docs/brave_signer_completion_zsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ brave_signer completion zsh [flags]

* [brave_signer completion](brave_signer_completion.md) - Generate the autocompletion script for the specified shell

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
16 changes: 12 additions & 4 deletions docs/brave_signer_keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ Manage key pairs.

### Synopsis

Use subcommands to create public/private key pairs in PEM files.
The keys command provides subcommands to create and manage Ed25519 public/private key pairs in PEM files.

Subcommands:
- generate: Generate a new Ed25519 key pair and store them in PEM files.

Features:
- Generate secure Ed25519 key pairs.
- Store keys in PEM files with encryption for private keys.


### Options

Expand All @@ -22,7 +30,7 @@ Use subcommands to create public/private key pairs in PEM files.

### SEE ALSO

* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and check signatures.
* [brave_signer keys generate](brave_signer_keys_generate.md) - Generates key pair.
* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and verify signatures.
* [brave_signer keys generate](brave_signer_keys_generate.md) - Generates an Ed25519 key pair.

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
28 changes: 16 additions & 12 deletions docs/brave_signer_keys_generate.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
## brave_signer keys generate

Generates key pair.
Generates an Ed25519 key pair.

### Synopsis

Generate an RSA key pair and store it in PEM files. The private key will be encrypted using a passphrase that you'll need to enter. AES encryption with Argon2 key derivation function is utilized.
Generate an Ed25519 key pair and store it in PEM files. The private key will be encrypted using a passphrase that you'll need to enter. AES encryption with the Argon2 key derivation function is utilized for strong security.

The following files will be created:
- A private key file (encrypted) in PEM format.
- A public key file in PEM format.


```
brave_signer keys generate [flags]
Expand All @@ -13,16 +18,15 @@ brave_signer keys generate [flags]
### Options

```
--argon2-key-len uint32 Key length parameter used in Argon2id (default 32)
--argon2-memory uint32 Memory parameter (megabytes) used in Argon2id (default 64)
--argon2-threads uint8 Threads parameter used in Argon2id (default 4)
--argon2-time uint32 Time parameter used in Argon2id (default 1)
--argon2-key-len uint32 Length of the derived key (in bytes) for the Argon2id key derivation function (default 32)
--argon2-memory uint32 Memory parameter (in megabytes) for the Argon2id key derivation function (default 64)
--argon2-threads uint8 Number of threads used in the Argon2id key derivation function (default 4)
--argon2-time uint32 Time parameter for the Argon2id key derivation function (default 1)
-h, --help help for generate
--priv-key-path string Path to save the private key (default "priv_key.pem")
--priv-key-size int Private key size in bits (default 2048)
--pub-key-path string Path to save the public key (default "pub_key.pem")
--salt-size int Salt size used in key derivation in bytes (default 16)
--skip-pem-presence-check Don't check if private and/or public keys already exist. Setting this option to true might result in overwriting your existing key pair.
--priv-key-path string Path to save the private key in PEM format (default "priv_key.pem")
--pub-key-path string Path to save the public key in PEM format (default "pub_key.pem")
--salt-size int Salt size (in bytes) used in the Argon2 key derivation process (default 16)
--skip-pem-presence-check Skip checking if private and/or public keys already exist. Setting this option to true might result in overwriting your existing key pair
```

### Options inherited from parent commands
Expand All @@ -37,4 +41,4 @@ brave_signer keys generate [flags]

* [brave_signer keys](brave_signer_keys.md) - Manage key pairs.

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
15 changes: 10 additions & 5 deletions docs/brave_signer_signatures.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ Create and verify signatures.

### Synopsis

Use subcommands to create signature (.sig) with private key and verify signature with public key.
The signatures command provides subcommands to create and verify digital signatures.

Features:
- Securely sign files to ensure their authenticity and integrity.
- Verify signatures to confirm the origin and integrity of files.


### Options

```
--file-path string Path to the file that should be signed
--hash-algo string Hashing algorithm to use (default "sha3-256")
--file-path string Path to the file that should be signed or verified
--hash-algo string Hashing algorithm to use for signing and verification (default "sha3-256")
-h, --help help for signatures
```

Expand All @@ -24,8 +29,8 @@ Use subcommands to create signature (.sig) with private key and verify signature

### SEE ALSO

* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and check signatures.
* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and verify signatures.
* [brave_signer signatures signfile](brave_signer_signatures_signfile.md) - Sign the file.
* [brave_signer signatures verifyfile](brave_signer_signatures_verifyfile.md) - Verify the signature of a file.

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
25 changes: 16 additions & 9 deletions docs/brave_signer_signatures_signfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ Sign the file.

### Synopsis

Sign the specified file using an RSA private key and store the signature inside a .sig file named after the original file. You'll be asked for a passphrase to decrypt the private key.
Sign the specified file using an Ed25519 private key and store the signature inside a .sig file named after the original file. You'll be asked for a passphrase to decrypt the private key.

The process involves:
1. Loading and decrypting the Ed25519 private key.
2. Hashing the file using the specified hash algorithm.
3. Signing the hash of the file.
4. Storing the signature along with the signer information in a .sig file located in the same directory as the original file.


```
brave_signer signatures signfile [flags]
Expand All @@ -13,12 +20,12 @@ brave_signer signatures signfile [flags]
### Options

```
--argon2-key-len uint32 Key length parameter used in Argon2id (default 32)
--argon2-memory uint32 Memory parameter (megabytes) used in Argon2id (default 64)
--argon2-threads uint8 Threads parameter used in Argon2id (default 4)
--argon2-time uint32 Time parameter used in Argon2id (default 1)
--argon2-key-len uint32 Length of the derived key (in bytes) for the Argon2id key derivation function (default 32)
--argon2-memory uint32 Memory parameter (in megabytes) used in the Argon2id key derivation function (default 64)
--argon2-threads uint8 Number of threads used in the Argon2id key derivation function (default 4)
--argon2-time uint32 Time parameter used in the Argon2id key derivation function (default 1)
-h, --help help for signfile
--priv-key-path string Path to your private key (default "priv_key.pem")
--priv-key-path string Path to your Ed25519 private key in PEM format (default "priv_key.pem")
--signer-id string Signer's name or identifier
```

Expand All @@ -28,12 +35,12 @@ brave_signer signatures signfile [flags]
--config-file-name string Your config file name. (default "config")
--config-file-type string Your config file type. (default "yaml")
--config-path string Config file location. (default ".")
--file-path string Path to the file that should be signed
--hash-algo string Hashing algorithm to use (default "sha3-256")
--file-path string Path to the file that should be signed or verified
--hash-algo string Hashing algorithm to use for signing and verification (default "sha3-256")
```

### SEE ALSO

* [brave_signer signatures](brave_signer_signatures.md) - Create and verify signatures.

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
17 changes: 12 additions & 5 deletions docs/brave_signer_signatures_verifyfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ Verify the signature of a file.

### Synopsis

Verify the digital signature of a specified file using an RSA public key. The command expects a signature file named "<original_filename>.sig" located in the same directory as the file being verified. The public key should be in PEM format.
Verify the digital signature of a specified file using an Ed25519 public key. The command expects a signature file named "<original_filename>.sig" located in the same directory as the file being verified. The public key should be in PEM format.

The process involves:
1. Loading the Ed25519 public key.
2. Reading the signature from the .sig file.
3. Hashing the file using the specified hash algorithm.
4. Verifying the signature against the hash of the file.


```
brave_signer signatures verifyfile [flags]
Expand All @@ -14,7 +21,7 @@ brave_signer signatures verifyfile [flags]

```
-h, --help help for verifyfile
--pub-key-path string Path to the public key (default "pub_key.pem")
--pub-key-path string Path to the Ed25519 public key in PEM format (default "pub_key.pem")
```

### Options inherited from parent commands
Expand All @@ -23,12 +30,12 @@ brave_signer signatures verifyfile [flags]
--config-file-name string Your config file name. (default "config")
--config-file-type string Your config file type. (default "yaml")
--config-path string Config file location. (default ".")
--file-path string Path to the file that should be signed
--hash-algo string Hashing algorithm to use (default "sha3-256")
--file-path string Path to the file that should be signed or verified
--hash-algo string Hashing algorithm to use for signing and verification (default "sha3-256")
```

### SEE ALSO

* [brave_signer signatures](brave_signer_signatures.md) - Create and verify signatures.

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024
4 changes: 2 additions & 2 deletions docs/brave_signer_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ brave_signer version [flags]

### SEE ALSO

* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and check signatures.
* [brave_signer](brave_signer.md) - Bravely generate key pairs, sign files, and verify signatures.

###### Auto generated by spf13/cobra on 20-Jun-2024
###### Auto generated by spf13/cobra on 1-Jul-2024

0 comments on commit 449fcd5

Please sign in to comment.