Take Apple CryptoKit to the command line and perform cryptographic operations securely and efficiently.
✅ Create or validate UUID (universally unique value).
✅ Perform cryptographically secure hashing (SHA-2 hash with 512, 384 or 256-bit digest).
✅ Create or validate HMAC (hash message authentication).
✅ Crypt and decrypt using AES-GCM cipher.
✅ Crypt and decrypt using ChaCha20-Poly1305 cipher.
✅ Symmetric key auto-hash to SHA-256 if needed.
🚧 X25519 key agreement and ed25519 signatures.
🚧 NIST P-521 signatures and key agreement.
🚧 NIST P-384 signatures and key agreement.
🚧 NIST P-256 signatures and key agreement.
Simply run:
$ cryptokit [subcommand]-h, --help: ShowCryptoKitCLIhelp information.--version: ShowCryptoKitCLIversion.
$ cryptokit uuid-c, --check <check>: Validate UUID string or file path.
$ cryptokit hash-d, --digest <digest>: SHA-2 hash with the chosen digest. (default: sha512)
$ cryptokit hmac-d, --digest <digest>: SHA-2 hash with the chosen digest. (default: sha512)-c, --check <check>: Validate HMAC string or file path.
$ cryptokit aes-n, --nonce <nonce>: Nonce string or file path.-a, --auth <auth>: Additional data string or file path.-d, --decrypt: Decrypt the input and verify authenticity using combined data.-t, --tag <tag>: Decrypt the input and verify authenticity using authentication tag and nonce.-s, --split: Print authentication tag and nonce instead of combined data.
$ cryptokit poly-n, --nonce <nonce>: Nonce string or file path.-a, --auth <auth>: Additional data string or file path.-d, --decrypt: Decrypt the input and verify authenticity using combined data.-t, --tag <tag>: Decrypt the input and verify authenticity using authentication tag and nonce.-s, --split: Print authentication tag and nonce instead of combined data.
- macOS 10.15+
There're more than one way to install CryptoKitCLI.
Using Homebrew:
$ brew install alexruperez/CryptoKitCLI/formulaUsing Mint:
$ mint install alexruperez/CryptoKitCLIMake sure Xcode 11.4+ is installed first.
$ git clone https://github.com/alexruperez/CryptoKitCLI.git
$ cd CryptoKitCLI
$ make installWith that installed and in the /usr/local/bin folder, now it's ready to serve.
Using Swift Package Manager:
Use as CLI
$ git clone https://github.com/alexruperez/CryptoKitCLI.git
$ cd CryptoKitCLI
$ swift runUse as dependency
Add the following to your Package.swift file's dependencies:
.package(url: "https://github.com/alexruperez/CryptoKitCLI.git", from: "0.1.0")And then import wherever needed: import CryptoKitCLI
For more information, see the Swift Package Manager documentation.
- Contributions are very welcome.
- Attribution is appreciated (let's spread the word!), but not mandatory.
Alex Rupérez – @alexruperez – me@alexruperez.com
CryptoKitCLI is available under the MIT license. See the LICENSE file for more info.