IfCrypt is an experimental encrypted-container format designed to provide multiple password-specific views of the same container.
A single IfCrypt container can hold multiple independent datasets. Different passwords can reveal different datasets, while the physical container is designed to look like random encrypted data without an obvious list of stored views.
Security status: Security-oriented beta / reference implementation. IfCrypt has not been independently audited and should not currently be considered a replacement for established encrypted-volume software.
- Multiple password-specific encrypted views
- Random-looking fixed-size container layout
- AES-256-GCM authenticated encryption
- Argon2id password-based key derivation
- HKDF-SHA256 key derivation
- Cryptographically secure random number generation
- Encrypted bootstrap records
- Encrypted multi-page manifests
- Disjoint allocation of data blocks between views
- Authentication of metadata and data blocks
- Atomic file creation and replacement
- Repacking for password rotation and view removal
- Corruption and tampering detection
- Configurable storage overhead
An IfCrypt container is divided into fixed-size blocks.
Conceptually:
┌──────────────────────────────────────────────┐
│ IfCrypt file │
├──────────────────────────────────────────────┤
│ Random-looking metadata / bootstrap records │
├──────────────────────────────────────────────┤
│ Encrypted manifest pages │
├──────────────────────────────────────────────┤
│ │
│ Encrypted data blocks │
│ │
│ View A → blocks 12, 48, 103, ... │
│ View B → blocks 7, 91, 214, ... │
│ View C → blocks 31, 56, 801, ... │
│ │
│ Unused / chaff space │
│ │
└──────────────────────────────────────────────┘
A password is processed through Argon2id to derive cryptographic keys.
The resulting keys allow IfCrypt to locate and authenticate the corresponding encrypted metadata and data blocks.
For example:
Password A
↓
Argon2id
↓
Derived keys
↓
View A manifest
↓
View A data blocks
Password B
↓
Argon2id
↓
Different derived keys
↓
View B manifest
↓
View B data blocks
The datasets are physically separated inside the container.
IfCrypt deliberately uses established cryptographic primitives instead of custom encryption algorithms.
AES-256-GCM is used for authenticated encryption.
It provides:
- Confidentiality
- Integrity
- Authentication
- Tamper detection
AES is standardized by NIST.
Passwords are processed using Argon2id before encryption keys are derived.
The default parameters are:
Memory: 64 MiB
Iterations: 3
Parallelism: 4
These parameters follow the second recommended Argon2id configuration described in RFC 9106, while remaining more practical for ordinary personal computers than the highest-memory profile.
HKDF-SHA256 is used to derive independent subkeys from the password-derived material.
Separate keys are used for different cryptographic roles.
Operating-system cryptographically secure random number generation is used for values such as:
- Container salts
- Epoch values
- Random padding
- Other required random material
IfCrypt is primarily designed against an attacker who obtains an encrypted container file and does not possess the corresponding password.
The design attempts to provide:
- Strong encryption of stored data.
- Authentication of encrypted data and metadata.
- Resistance against offline password guessing through Argon2id.
- Separation between password-specific datasets.
- A random-looking fixed-size physical layout.
- No plaintext filenames or ordinary directory structure in the container.
- No explicit public list of the number of views.
The design is plausible-deniability-oriented, but it does not claim mathematically proven or formally established plausible deniability.
IfCrypt does not protect against a compromised computer.
For example, it cannot protect plaintext if an attacker already controls the machine through:
- Malware
- Keyloggers
- Screen capture
- Memory inspection
- Compromised operating systems
- Malicious applications
- Previously copied plaintext files
Other important limitations include:
Argon2id makes password guessing more expensive, but it cannot make a weak password secure.
Use a strong, unique password.
A previously copied container remains a valid snapshot.
Deleting or changing data in a newer container does not erase previously obtained copies.
If an attacker can replace the current container with an older valid copy, IfCrypt cannot independently determine that the snapshot is old without an external monotonic state or trusted versioning mechanism.
Removing a file from a container does not guarantee that an attacker who already obtained an older container snapshot cannot recover the old data.
For sensitive deletion, create a fresh container through the appropriate repacking workflow and securely handle old copies.
Random-looking storage and hidden manifests are intended to make the existence of additional views difficult to infer.
This is an engineering goal, not a formal cryptographic proof of indistinguishability or coercion resistance.
from ifcrypt import create_file, open_view_file
create_file(
"secret.ifc",
{
"password-one": b"First dataset",
"password-two": b"Second dataset",
},
overhead=5,
)
data = open_view_file(
"secret.ifc",
"password-one",
)
print(data)Opening the same container with a different password accesses a different dataset.
IfCrypt can allocate additional space to make the physical container substantially larger than the plaintext data.
For example:
overhead = 3
overhead = 5
overhead = 8
Higher overhead provides more unused/chaff space but increases storage requirements.
The overhead parameter is a storage-layout parameter, not a guarantee of plausible deniability.
IfCrypt supports creating a fresh container from selected views.
Repacking can be useful for:
- Removing a view
- Rotating passwords
- Changing storage allocation
- Creating a fresh snapshot
- Reducing the usefulness of old container snapshots
A fresh container should be treated as a new cryptographic snapshot.
The current format version is:
IfCrypt Format v8
The implementation intentionally avoids storing an ordinary human-readable header containing information such as:
- Number of views
- View names
- Plaintext sizes
- Password count
- Directory listings
The container geometry is derived from its file size and fixed format parameters.
Cryptographic metadata is authenticated and encrypted.
The current security test harness performs 104 checks covering areas such as:
- Multiple views
- Correct password authentication
- Wrong password rejection
- Corruption detection
- Tampering detection
- Allocation separation
- Fixed-size behavior
- Random-looking ciphertext properties
- Snapshot differences
- Manifest integrity
- Repacking
- Boundary conditions
Current local result:
PASS 104 FAIL 0
These tests are useful for detecting implementation regressions, but passing them does not constitute a cryptographic security audit or proof of security.
pip install cryptography argon2-cffiFor development and testing:
pip install pytest- Python 3.10+
cryptographyargon2-cffi
IfCrypt is currently a security-oriented experimental project.
The implementation focuses on:
- Conservative cryptographic primitives
- Explicit security boundaries
- Defensive parsing
- Authentication of metadata
- Deterministic and disjoint allocation
- Extensive implementation testing
However, it has not yet received an independent professional cryptographic audit.
Before using IfCrypt to protect highly valuable or irreplaceable information, an established and independently reviewed encrypted-storage solution should be preferred.
If you discover a potential security vulnerability, please read SECURITY.md before opening a public issue.
Please avoid publicly disclosing an exploitable vulnerability before there is an opportunity to investigate and address it.
This project is released under the license included in LICENSE.
IfCrypt is provided for research, experimentation, and personal use.
The authors make no guarantee that the implementation is secure against every possible attack.
Do not treat IfCrypt as audited cryptographic software.
The security of the system depends not only on the cryptographic primitives but also on the implementation, operating system, password handling, backups, and operational practices.