Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Encrypt/decrypt files passwordlessly using GitHub's public key.

License

NotificationsYou must be signed in to change notification settings

yoshi389111/git-caesar

Repository files navigation

NAME

git-caesar — Command-line tool for encrypting and decrypting files using public key cryptography

SYNOPSIS

git-caesar [OPTIONS]

DESCRIPTION

git-caesar is a command-line tool that encrypts and decrypts files using public keys registered on GitHub, GitLab, or local SSH key files.Encryption uses the recipient's public key. Decryption uses your private key.

OPTIONS

  • -h,--help

    • Show help and exit.
  • -v,--version

    • Show version and exit.
  • -u,--public=<target>

    • Specify recipient's public key. Required for encryption.If a GitHub username is provided, the key is fetched fromhttps://github.com/USER_NAME.keys.If the value starts withhttp: orhttps:, the key is fetched from the web.Otherwise, it is treated as a local file path.Used for signature verification in decryption.
  • -k,--private=<id_file>

    • Specify your SSH private key file.If omitted, the tool searches~/.ssh/id_ecdsa,~/.ssh/id_ed25519,~/.ssh/id_rsa in that order.
  • -i,--input=<input_file>

    • Path to input file.For encryption, this is the plaintext file.For decryption, this is the encrypted file.Defaults to stdin.
  • -o,--output=<output_file>

    • Path to output file.Defaults to stdout.
  • -d,--decrypt

    • Decrypt mode. If not specified, encrypt mode is used.
  • -F,--format-version=<version>

    • Format version of the encrypted file.Versions1,2 and3 are valid. Version1 and2 is deprecated.Default:3.

EXAMPLES

  • Encryptsecret.txt for GitHub useroctocat and save assecret.zip:

    git-caesar -u octocat -i secret.txt -o secret.zip
  • Encrypt using a specific private key (~/.ssh/id_secret):

    git-caesar -u octocat -i secret.txt -o secret.zip -k~/.ssh/id_secret
  • Decrypt a file for GitLab usertanuki and save it assecret.txt:

    git-caesar -d -u https://gitlab.com/tanuki.keys -i secret.zip -o secret.txt
  • Decrypt a file without signature verification:

    git-caesar -d -i secret.zip -o secret.txt

INSTALLATION

How to build with GO command

Requires Go 1.24.0 or higher

See below for how to install/upgrade.

go install github.com/yoshi389111/git-caesar@latest

See below for how to uninstall.

go clean -i github.com/yoshi389111/git-caesar

How to install using Homebrew

See below for how to install/upgrade.

brew install yoshi389111/apps/git-caesar

See below for how to uninstall.

brew uninstall yoshi389111/apps/git-caesar

Download from GitHub

Download the file that matches your operating environment from "Releases."

SUPPORTED ALGORITHMS

Supported Public Key Algorithms

  • ssh-rsa (key length 1024 bits or more)
  • ecdsa-sha2-nistp256
  • ecdsa-sha2-nistp384
  • ecdsa-sha2-nistp521
  • ssh-ed25519

Unsupported:

  • ssh-dss (DSA)
  • ssh-rsa (key length less than 1024 bits)
  • sk-ecdsa-sha2-nistp256@openssh.com
  • sk-ssh-ed25519@openssh.com

Encryption and Signature Algorithms

Format version 3 (recommended)

  • supported since v0.0.10
AlgorithmEncryption/DecryptionSigning/Verification
AESAES-256-GCMN/A
RSA (≤ 4096-bit)RSA-OAEP (SHA-256)RSA-PSS (SHA-256)
RSA (> 4096-bit)RSA-OAEP (SHA-256)RSA-PSS (SHA-512)
ECDSA/ECDH (P-256)ECDH + HKDF-SHA-256 + AES-256-GCMECDSA (SHA-256)
ECDSA/ECDH (P-384)ECDH + HKDF-SHA-256 + AES-256-GCMECDSA (SHA-384)
ECDSA/ECDH (P-521)ECDH + HKDF-SHA-256 + AES-256-GCMECDSA (SHA-512)
ED25519/X25519X25519 + HKDF-SHA-256 + AES-256-GCMED25519 (SHA-512)
Old format versions

Format version 2

  • supported since v0.0.9
  • deprecated since v0.0.10
AlgorithmEncryption/DecryptionSigning/Verification
AESAES-256-GCMN/A
RSARSA-OAEP (SHA-256)RSA-PSS (SHA-256)
ECDSA/ECDHECDH + HKDF-SHA-256 + AES-256-GCMECDSA (SHA-256)⚠️
ED25519/X25519X25519 + HKDF-SHA-256 + AES-256-GCMED25519 (SHA-512)

Format version 1

  • supported since v0.0.1
  • deprecated since v0.0.9
AlgorithmEncryption/DecryptionSigning/Verification
AESAES-256-CBCN/A
RSARSA-OAEP (SHA-256)RSA-PKCS1-v1_5 (SHA-256)
ECDSA/ECDHECDH +⚠️SHA-256 (for key derivation) + AES-256-CBCECDSA (SHA-256)
ED25519/X25519X25519 +⚠️SHA-256 (for key derivation) + AES-256-CBCED25519 (⚠️with pre-hashed SHA-256 input)

SECURITY

In this tool, the ECDSA and ED25519 signing public keys are reused for key exchange (ECDH / X25519).

  • Using the signing public key for key exchange does not directly leak the recipient’s signing private key during the key exchange itself, because the private key is not transmitted or revealed in the protocol.
  • The sender’s signing private key is also not leaked, as an ephemeral key for key exchange is used for each session on the sender’s side, and the sender's signing key is used only for signing.

However, this practice has the following potential security risks:

  • If the signing private key is compromised, all past key exchanges using that key can be broken retroactively (forward secrecy is lost).
  • Increased use of the signing private key raises the risk of side-channel attacks.

SEE ALSO

COPYRIGHT

© 2023 SATO, Yoshiyuki. MIT Licensed.

About

Encrypt/decrypt files passwordlessly using GitHub's public key.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp