IronCrypt
- IronCrypt
IronCrypt is a Command-Line Interface (CLI) tool and Rust library dedicated to secure password and data encryption. By combining the Argon2 hashing algorithm, AES-256-GCM or XChaCha20-Poly1305 for symmetric encryption, and modern asymmetric cryptography like RSA or Elliptic Curve Cryptography (ECC), IronCrypt provides a robust, flexible solution to ensure your application’s data confidentiality and password security.
Features
- Modern, Hybrid Encryption: IronCrypt uses a robust hybrid encryption model. It encrypts data with a high-performance symmetric cipher (AES-256-GCM or XChaCha20-Poly1305) and protects the symmetric key using state-of-the-art asymmetric cryptography. This "envelope encryption" provides the best of both worlds: the speed of symmetric ciphers and the secure key management of public-key cryptography.
- Flexible Asymmetric Cryptography: Choose between RSA for broad compatibility or Elliptic Curve Cryptography (ECC) for higher performance and smaller key sizes, offering equivalent security with less overhead. Both are fully supported for encryption and digital signatures.
- Multi-Recipient Encryption: Natively supports encrypting a single file or directory for multiple users, even with different key types (e.g., some recipients using RSA, others ECC). Each user can decrypt the data with their own unique private key, without needing to share secrets.
- Passphrase-Encrypted Keys: Private keys can be optionally encrypted with a user-provided passphrase for an added layer of security, protecting them even if the key files are exposed.
- State-of-the-Art Password Hashing: For passwords, IronCrypt uses Argon2, currently considered one of the most secure hashing algorithms in the world. It is specifically designed to resist modern GPU-based brute-force attacks, providing much greater security than older algorithms.
- Advanced Key Management: The built-in key versioning system (
-v v1,-v v2) and the dedicatedrotate-keycommand allow you to update your encryption keys over time. This automates the process of migrating to a new key without having to manually decrypt and re-encrypt all your data. IronCrypt can load both modern PKCS#8 keys and legacy PKCS#1 keys, ensuring broad compatibility. - Flexible Configuration: You can finely tune security parameters via the
ironcrypt.tomlfile, environment variables, or theIronCryptConfigstruct in code. This includes RSA key size and the computational "costs" of the Argon2 algorithm, allowing you to balance security and performance to fit your needs. - Streaming Encryption: For AES-256-GCM without signatures, IronCrypt encrypts and decrypts in chunks without loading the whole file into memory. Limits: (1) XChaCha20-Poly1305 is one-shot (plaintext is buffered); (2) a signature in the header also requires pre-buffering the content for hashing. Prefer unsigned AES for very large files.
- Comprehensive Data Encryption: IronCrypt is built to handle more than just passwords. It can encrypt any file (images, PDFs, documents), entire directories (by archiving them first), or any other data that can be represented as a stream of bytes.
- Dual Use (CLI and Library): IronCrypt is designed from the ground up to be dual-purpose. You can use it as a quick command-line tool for simple tasks, or integrate it as a library (crate) directly into your own Rust applications for more complex logic.
Quick start
Copy-paste examples aligned with the current code.
1. Prepare a local lab
# Copy example fixtures (never commit real keys)
# → keys.json, ironcrypt.toml, keys/private_key_v1.pem, keys/public_key_v1.pem
2. CLI — keys, file, password
# Password (Argon2id hash sealed in JSON — never stored in cleartext)
3. HTTP daemon (ironcryptd)
API permissions: read, write, delete, update, full.
Endpoints: POST /write (encrypt) and POST /read (decrypt).
# → note the secret API key (base64) and the Hash (SHA-512 hex)
# keys.json uses camelCase, e.g.:
# { "description": "lab", "keyHash": "<HASH_HEX>", "permissions": ["write", "read"] }
|
# Optional Argon2 gate: -H "X-Password: Str0ngP@ssw0rd42!"
In-process HTTPS:
4. Docker Compose (lab vs prod)
# make prod
5. Rust library (AES streaming)
use ;
use Cursor;
Using IronCrypt from PHP
PHP applications do not link the Rust crate. They talk to the ironcryptd HTTP daemon with the small client in sdks/php (IronCryptClient).
PHP app --POST /write|/read + Bearer--> ironcryptd (holds PEM keys)
Why this model?
- One crypto service shared by PHP, Python, curl, etc.
- API keys with fine-grained permissions (
write,read, …) - No need to ship private keys inside every PHP container
Setup
# 1) Daemon (from repo root)
&&
# 2) PHP SDK
&&
keys.json must use camelCase (keyHash) and permissions such as ["write", "read"].
Send the secret API key as Authorization: Bearer … without re-encoding it.
Minimal PHP example
Store ciphertext as a DB BLOB or base64_encode($ciphertext) for text columns.
Full walkthrough (Composer path repo, cURL without SDK, errors 401/403/429, alternatives CLI/FFI): see sdks/php/README.md.
Python HTTP client: sdks/python.
Using IronCrypt via FFI (C ABI)
For in-process use (no HTTP daemon), link or load the dynamic library built by Cargo (cdylib) and call the C API declared in ironcrypt.h.
Python / Java / C# / C / PHP-FFI --native calls--> libironcrypt (.so / .dylib / .dll)
FFI vs daemon
FFI (libironcrypt) |
HTTP (ironcryptd + SDKs) |
|
|---|---|---|
| Process | Same process as your app | Separate service |
| Auth | You pass PEM material yourself | API key Bearer + permissions |
| Best for | Native apps, JVM/.NET, low latency | PHP/web, multi-language microservices |
| C API scope today | Password workflow (Argon2 + RSA envelope) | Files/streams via /write /read, secrets, … |
Build the library
# Linux: target/release/libironcrypt.so
# macOS: target/release/libironcrypt.dylib
# Windows: target/release/ironcrypt.dll
API surface
| Function | Success | Role |
|---|---|---|
ironcrypt_generate_rsa_keys |
0 |
Allocate PEM private/public strings |
ironcrypt_password_encrypt |
0 |
Password → sealed JSON |
ironcrypt_password_verify |
1 / 0 / -1 |
Valid / invalid / error |
ironcrypt_free_string |
— | Must free every string Rust allocated |
Minimal idea (Python ctypes)
= # .so on Linux
=
# … set argtypes, call encrypt/verify, then:
# lib.ironcrypt_free_string(ptr)
Native C sample: examples/c_api_usage.c.
Full examples (Python ctypes, Java JNA, C# P/Invoke, PHP FFI, build flags, troubleshooting): FFI_EXAMPLES.md.
Workflows
Password Encryption/Decryption

This process ensures maximum security by combining robust hashing with Argon2 and hybrid encryption (called "envelope encryption") with AES and RSA.
1. Encryption Process (e.g., during user registration)
The goal here is not to encrypt the password itself, but to encrypt a unique fingerprint (a "hash") of that password. The plaintext password is never stored.
-
Password Hashing:
- The password provided by the user (e.g.,
"MyPassword123") is first passed through the Argon2 hashing algorithm. - Argon2 transforms it into a unique and non-reversible digital fingerprint (the "hash"). This algorithm is designed to be slow and memory-intensive, making it extremely resistant to modern brute-force attacks.
- The password provided by the user (e.g.,
-
Creating the Encryption Envelope:
- A new AES-256 symmetric encryption key is randomly generated. This key is for one-time use and will only be used for this operation.
- The Argon2 hash (created in step 1) is then encrypted using this AES key.
-
Securing the AES Key (the "seal" of the envelope):
- To be able to verify the password later, the AES key must be saved. Storing it in plaintext would be a security flaw.
- Therefore, the AES key is itself encrypted, but this time with your public RSA key. Only the holder of the corresponding private RSA key will be able to decrypt this AES key.
-
Storing the Secure Data:
- The final result is a structured JSON object that contains all the necessary information for future verification:
- The encrypted Argon2 hash (AES ciphertext) — the hash is never duplicated in cleartext in the JSON.
- The AES key encrypted with RSA/ECC (envelope).
- Public technical parameters (nonce, key version, algorithm).
- It is this JSON object that is securely stored in your database.
- The final result is a structured JSON object that contains all the necessary information for future verification:
2. Verification Process (e.g., during user login)
The goal here is to verify if the password provided by the user matches the stored one, without ever having to see it in plaintext.
-
Data Retrieval:
- The user logs in by providing their password (e.g.,
"MyPassword123"). - You retrieve the corresponding JSON object for this user from your database.
- The user logs in by providing their password (e.g.,
-
Opening the Envelope:
- Using your private RSA key, you decrypt the AES key contained in the JSON.
- Once the plaintext AES key is obtained, you use it to decrypt the original Argon2 hash.
-
Real-time Hashing and Comparison:
- The password just provided by the user for login is hashed in turn, using the exact same parameters (the "salt") as those stored in the JSON.
- The two hashes—the one just generated and the one decrypted from the database—are compared.
-
Verification Result:
- If the two hashes are identical, it proves that the provided password is correct. Access is granted.
- If they are different, the password is incorrect. Access is denied.
This workflow ensures that even if your database were compromised, the users' passwords would remain unusable by an attacker, as the original password is never stored there.
File Encryption/Decryption

This process also uses envelope encryption (AES + RSA) to ensure both performance and security.
1. Encryption Process
- Opening File Streams: IronCrypt opens the input file for reading and the output file for writing. In AES-256-GCM without a signature, content is processed in chunks (streaming). With XChaCha20 or a signature, an in-memory buffer of the content is required (see Features).
- Creating the Envelope Header:
- A new one-time use AES-256 key is randomly generated.
- This AES key is encrypted with one or more public RSA keys (one for each recipient).
- A JSON header is created containing a list of recipients, where each entry contains the encrypted AES key for that user and their key version.
- Streaming Encryption:
- The JSON header is written to the start of the output file.
- IronCrypt then reads the input file in small chunks, encrypts each chunk with the AES key, and immediately writes the encrypted chunk to the output file.
- Finalizing: Once the entire file has been processed, an authentication tag is appended to the end of the output file to ensure its integrity.
2. Decryption Process
- Reading the Header: IronCrypt reads the JSON header from the start of the encrypted file.
- Opening the Envelope:
- Your private RSA key is used to find your entry in the recipients list and decrypt the AES key.
- Streaming Decryption:
- With the AES key, IronCrypt reads the rest of the encrypted file in chunks, decrypts each chunk, and writes the plaintext data to the output file.
- Verification and Saving: After processing all chunks, it verifies the authentication tag. If valid, the original file is fully restored.
Directory Encryption/Decryption

Encrypting an entire directory is based on the file encryption workflow, with an additional preparation step.
1. Encryption Process
- Archiving and Compression:
- The target directory is first read, and all its files and subdirectories are compressed into a single
.tar.gzarchive, which is written to a temporary file on disk.
- The target directory is first read, and all its files and subdirectories are compressed into a single
- Encrypting the archive:
- This temporary
.tar.gzarchive is then encrypted using the streaming file encryption process described above.
- This temporary
- Storage: The resulting JSON is saved to a single encrypted file.
2. Decryption Process
- Decrypting the archive:
- The file decryption process is used to retrieve the plaintext
.tar.gzarchive.
- The file decryption process is used to retrieve the plaintext
- Decompression and Extraction:
- The
.tar.gzarchive is then decompressed, and its contents are extracted to the destination directory, thus recreating the original structure and files.
- The
Installation
Prerequisites
- Rust ≥ 1.88 (MSRV for the default library build — see
rust-versioninCargo.toml) - Latest stable recommended for CLI /
full/ cloud features - Cargo (Rust's package manager)
MSRV notes
| Feature set | Minimum rustc (approx.) | Notes |
|---|---|---|
| default (library) | 1.88 | Guaranteed / CI-tested (time etc. in the lockfile) |
cli / daemon / full (no AWS bump) |
1.88 | Same baseline |
aws / current AWS SDK in the lockfile |
1.94.1+ | Upstream aws-config / Smithy crates declare this |
The CI job MSRV 1.88 runs cargo check/test --lib on every push.
Building and Running from Source
There are three main ways to run the ironcrypt command-line tool.
1. Using cargo run (Recommended for development)
This command compiles and runs the program in one step. Use -- to separate cargo's arguments from your program's arguments.
# Clone the repository
# Run the --help command (CLI feature required)
2. Building and running the executable directly
You can build the executable and then run it from its path in the target directory.
# Build the optimized CLI (+ daemon) — defaults are library-only
# Run it from its path
3. Installing the binary (Recommended for usage)
This will install the ironcrypt command on your system, making it available from any directory. This is the best option for regular use.
# From the root of the project directory, run:
# Or from crates.io (once published):
# cargo install ironcrypt --features full
# Now you can use the command from anywhere
4. Building a static Linux binary (MUSL)
Build portable static binaries (no glibc required), useful for minimal containers and Alpine.
Prerequisites (choose your OS):
- Debian/Ubuntu:
&&
- macOS (Homebrew):
Build the release binaries:
# Binaries:
# target/x86_64-unknown-linux-musl/release/ironcrypt
# target/x86_64-unknown-linux-musl/release/ironcryptd
Note: The repo’s .cargo/config.toml is already configured for MUSL (musl-gcc + lld). If you see “musl-gcc not found”, install musl-tools (Linux) or musl-cross (macOS) as above.
5. Build and run with Docker
A multi-stage Dockerfile builds static binaries and ships a tiny runtime image.
CI publishes images to GitHub Container Registry on every master push:
Build the image locally:
Run the CLI inside the container:
Run the daemon (exposes port 3000, mounts host keys directory):
# Generate or place your keys in ./keys first
# Note: the daemon currently binds to 127.0.0.1 inside the container.
# It will be reachable from inside the container. To reach it from the host,
# bind the server to 0.0.0.0 in code or use an alternative networking setup.
6. Using the Makefile (Docker Compose)
Shortcuts for lab / prod stacks.
Prerequisites: Docker and Docker Compose v2 (docker compose).
Notes:
Default target is all -> lab.
Optimized Builds with Feature Flags
IronCrypt is library-first on crates.io: the default feature set is empty (crypto API only). Binaries and cloud backends are opt-in via features — this keeps consumer dependency trees lean.
Available Features:
- (default): library only — password / stream / RSA-ECC crypto API.
cli: Builds theironcryptCLI.daemon: Buildsironcryptdand enables thedaemonCLI subcommand.interactive: Progress indicators in the CLI (requirescli).aws/azure/vault: secret backends (awscurrently needs rustc ≥ 1.94.1).gcp: Google Secret Manager (optional, pullstonic— outsidecloud/full).hsm: PKCS#11 backend.cloud:aws+azure+vault(nogcp).full:cli+daemon+cloud+interactive(batteries-included meta feature).
As a library dependency:
# Lean (recommended for apps)
= "0.1"
# With optional backends
= { = "0.1", = ["vault"] }
Local Builds with cargo:
# Library only (same as crates.io default)
# Minimal CLI binary
# CLI with AWS support and interactive spinners
# Daemon with cloud providers
# Everything except gcp/hsm
Custom Docker Builds:
You can pass the features to the Docker build using the IRONCRYPT_FEATURES build argument.
# Build a minimal Docker image with only the CLI tool
# Build a Docker image with the daemon and Azure support
Usage
Command-Line Interface (CLI)
Here is a summary table of all available commands:
| Command | Alias | Description | Key Options |
|---|---|---|---|
generate |
Generates a new RSA key pair. | -v, --version <VERSION> -d, --directory <DIR> -s, --key-size <SIZE> [--passphrase <PASSPHRASE>] |
|
encrypt |
Hashes and encrypts a password. | -w, --password <PASSWORD> -d, --public-key-directory <DIR> -v, --key-version <VERSION> |
|
decrypt |
Verifies an encrypted password. | -w, --password <PASSWORD> -k, --private-key-directory <DIR> -f, --file <FILE> [--passphrase <PASSPHRASE>] |
|
encrypt-file |
encfile, efile, ef |
Encrypts a binary file. | -i, --input-file <INPUT> -o, --output-file <OUTPUT> -d, --public-key-directory <DIR> -v, --key-version <VERSION>... [-w, --password <PASSWORD>] |
decrypt-file |
decfile, dfile, df |
Decrypts a binary file. | -i, --input-file <INPUT> -o, --output-file <OUTPUT> -k, --private-key-directory <DIR> -v, --key-version <VERSION> [-w, --password <PASSWORD>] [--passphrase <PASSPHRASE>] |
encrypt-dir |
encdir |
Encrypts an entire directory. | -i, --input-dir <INPUT> -o, --output-file <OUTPUT> -d, --public-key-directory <DIR> -v, --key-version <VERSION>... [-w, --password <PASSWORD>] |
decrypt-dir |
decdir |
Decrypts an entire directory. | -i, --input-file <INPUT> -o, --output-dir <OUTPUT> -k, --private-key-directory <DIR> -v, --key-version <VERSION> [-w, --password <PASSWORD>] [--passphrase <PASSPHRASE>] |
rotate-key |
rk |
Rotates encryption keys for encrypted data. | --old-version <OLD_V> --new-version <NEW_V> -k, --key-directory <DIR> `[--file |
sign |
Creates a detached signature for a file. | -i, --input-file <INPUT> -o, --output-file <OUTPUT> -k, --key-directory <DIR> -v, --key-version <VERSION> [--passphrase <PASSPHRASE>] |
|
verify |
Verifies a detached signature for a file. | -i, --input-file <INPUT> -s, --signature-file <SIG> -d, --public-key-directory <DIR> -v, --key-version <VERSION> |
A full list of commands and their arguments can be viewed by running ironcrypt --help. To get help for a specific command, run ironcrypt <command> --help.
generate
Generates a new RSA key pair (private and public).
Usage:
Example:
# Generate a new v2 key with a size of 4096 bits in the "my_keys" directory
# Generate a new v3 key protected by a passphrase
encrypt
Hashes and encrypts a password.
Usage:
Example:
# Encrypt a password using the v1 public key
decrypt
Decrypts and verifies a password.
Usage:
Example:
# Verify a password using the v1 private key and the encrypted data from a file
# Verify using a key protected by a passphrase
encrypt-file
Encrypts a single file.
Usage:
Example:
# Encrypt a file for a single user (v1)
# Encrypt a file for multiple users (v1 and v2)
decrypt-file
Decrypts a single file.
Usage:
Example:
# Decrypt a file with the v1 private key
# Decrypt a file using a key protected by a passphrase
encrypt-dir
Encrypts an entire directory by first archiving it into a .tar.gz.
Usage:
Example:
# Encrypt the "my_project" directory for multiple users
decrypt-dir
Decrypts and extracts a directory.
Usage:
Example:
# Decrypt the "my_project.enc" file into the "decrypted_project" directory
rotate-key
Rotates encryption keys for a file or a directory of files.
Usage:
Example:
# Rotate keys from v1 to v2 for a single file
sign
Creates a detached signature for a file. This can be used to prove the file's authenticity and integrity.
Usage:
Example:
# Sign a document with a v1 private key
# Sign a file with a passphrase-protected ECC key
verify
Verifies a detached signature against a file. This confirms that the file has not been tampered with since it was signed by the holder of the corresponding private key.
Usage:
Example:
# Verify the signature for my_document.pdf using the v1 public key
As a Library (Crate)
You can also use ironcrypt as a library in your Rust projects. Add it to your Cargo.toml:
[]
= "0.1.2" # Replace with the desired version from crates.io
Runnable copies of the snippets below live in examples/ (cargo run --example password, cargo run --example stream_aes). They are also checked by cargo test --doc.
Encrypting and Verifying a Password
use ;
use HashMap;
use Error;
async
Encrypting and Decrypting a File (Streaming)
use ;
use Cursor;
Transparent Encryption Daemon
For language-agnostic integration, ironcryptd exposes a streaming HTTP API.
Daemon Configuration
Config is a flat TOML matching IronCryptConfig (see ironcrypt.toml.example).
Minimal ironcrypt.toml:
= "Nist"
= 8192
= 2048
= 65536
= 3
= 1
[]
= 12
Starting the Daemon
Non-loopback HTTP requires TLS (--tls-cert / --tls-key) or --allow-insecure-http.
Daemon Authentication
1. Generate an API key
You get:
- Secret API key (base64) — send as
Authorization: Bearer … - Hash (SHA-512 hex) — store in
keys.jsonaskeyHash
2. keys.json (camelCase)
Valid permissions: write, read, delete, update, full.
Fixtures: keys.json.example, private_key_v1.pem.example / public_key_v1.pem.example (make bootstrap-lab).
3. Authenticated requests
|
|
Typical errors: 401 (missing/invalid key), 403 (permission), 429 (rate limit), 400 (crypto / bad password).
API Endpoints
| Method | Path | Permission | Role |
|---|---|---|---|
POST |
/write |
write |
Encrypt request body |
POST |
/read |
read |
Decrypt request body |
GET |
/service/:name/secret/:key |
read |
Read cloud secret |
POST |
/service/:name/secret/:key |
write |
Write cloud secret |
CORS is off by default; whitelist with --cors-origins https://app.example.com.
High Availability
The ironcryptd daemon is designed to be stateless, meaning it does not store any session or request-specific data between requests. This architecture makes it horizontally scalable and highly available. You can run multiple instances of the daemon behind a load balancer to distribute traffic and ensure service continuity even if one of the instances fails.
Key Requirements for a High-Availability Setup:
- Shared Configuration: All
ironcryptdinstances must be started with the same configuration. This is best achieved by using a centralizedironcrypt.tomlconfiguration file for all instances. - Shared Key Storage: All instances must have access to the same set of encryption keys. This can be achieved by:
- Placing the key directory on a shared network file system (e.g., NFS, GlusterFS).
- Using a configuration management tool (e.g., Ansible, Puppet) to deploy the same key files to each node.
- Centralized Logging: To monitor and audit the cluster, the logs from all instances (both standard and audit logs) should be forwarded to a centralized logging system (e.g., ELK Stack, Splunk, Graylog).
Example: Load Balancing with Nginx
Here is a sample Nginx configuration that demonstrates how to load balance traffic between two ironcryptd instances running on localhost at ports 3000 and 3001.
# /etc/nginx/nginx.conf
http {
# Define a group of upstream servers
upstream ironcryptd_cluster {
# Use a load balancing algorithm, e.g., round-robin (default) or least_conn
# least_conn;
server 127.0.0.1:3000;
server 127.0.0.1:3001;
}
server {
listen 80;
location / {
# Forward requests to the upstream cluster
proxy_pass http://ironcryptd_cluster;
# Set headers to pass client information to the daemon
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
With this configuration, Nginx will listen on port 80 and distribute incoming requests (/write, /read, …) between the two daemon instances, providing both load balancing and redundancy.
Database Integration Examples
Here are some examples of how to use ironcrypt with popular web frameworks and a PostgreSQL database. These examples use the sqlx crate for database interaction.
Actix-web Example
This example shows how to create a simple web service with actix-web that can register and log in users.
Dependencies:
[]
= "0.1.2"
= "4"
= { = "0.7", = ["runtime-async-std-native-tls", "postgres"] }
= { = "1.0", = ["derive"] }
= { = "1", = ["full"] }
Code:
use ;
use PgPoolOptions;
use PgPool;
use ;
use Deserialize;
async
async
async
Rocket Example
This example shows how to achieve the same functionality using the rocket framework.
Dependencies:
[]
= "0.1.2"
= { = "0.5.0", = ["json"] }
= { = "0.7", = ["runtime-tokio-native-tls", "postgres"] }
= { = "1.0", = ["derive"] }
Code:
extern crate rocket;
use Json;
use State;
use PgPoolOptions;
use PgPool;
use ;
use Deserialize;
async
async
async
Configuration
IronCrypt can be configured in three ways, in order of precedence:
ironcrypt.tomlfile: Point the CLI (ironcrypt) or the daemon (ironcryptd) at it with--config ironcrypt.toml, or setIRONCRYPT_CONFIG_FILE.--configis a global flag, so it works before or after the subcommand (e.g.ironcrypt --config ironcrypt.toml encrypt-file ...orironcrypt encrypt-file --config ironcrypt.toml ...). Without it, secure defaults are used — the file is never auto-discovered from the current directory.- Environment Variables: Set variables like
IRONCRYPT_KEY_DIRECTORY. - Command-Line Arguments: Flags like
--key-directoryoverride all other methods.
For library usage, you can construct an IronCryptConfig struct and pass it to IronCrypt::new.
Cryptographic Algorithm Configuration
Tune algorithms via flat ironcrypt.toml fields (see ironcrypt.toml.example).
# Standards: "Nist" | "Fips140_2" | "Anssi" | "Custom"
= "Nist"
= 2048
= 8192
= 65536
= 3
= 1
[]
= 12
Custom mode:
= "Custom"
= "ChaCha20Poly1305" # or "Aes256Gcm"
= "Ecc" # or "Rsa"
= 4096 # ignored when Ecc
Anssi forces AES-256-GCM + RSA 3072. For ECC, use standard = "Custom" with asymmetric_algorithm = "Ecc".
Secret Management Configuration
To use IronCrypt with a secret management system like HashiCorp Vault, AWS Secrets Manager, or Azure Key Vault, you need to enable the corresponding feature flag during compilation and configure it in your ironcrypt.toml file.
First, specify the provider you want to use:
[]
= "vault" # or "aws", "azure"
Then, provide the specific configuration for your chosen provider.
HashiCorp Vault (vault feature)
[]
= "http://127.0.0.1:8200" # Address of your Vault server
= "YOUR_VAULT_TOKEN" # Vault token with access to the secret engine
= "secret" # Mount path of the KVv2 secrets engine (optional, defaults to "secret")
Security and Best Practices
- Protect Your Private Keys: Never expose your private keys. Store them in a secure, non-public location. If possible, encrypt them with a strong, unique passphrase using the
--passphraseoption during generation. - Use Strong Passwords: When using the password feature for file/directory encryption, ensure the password is strong.
- Rotate Keys Regularly: Use the
rotate-keycommand to update your encryption keys periodically. - Backup Your Keys: Keep secure backups of your keys. If you lose a private key, you will not be able to decrypt your data.
Contribution
Contributions are welcome! If you'd like to contribute, please follow these steps:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix.
- Commit your changes and push them to your fork.
- Submit a pull request with a clear description of your changes.
License
IronCrypt is licensed under the MIT License. See the LICENSE file for details.