Metadata-Version: 2.4
Name: ncr-cipher
Version: 1.0.0
Summary: Production-grade NCR3 encryption tool — encrypt, decrypt, and verify files from any terminal.
Author: ncr-cipher contributors
License: MIT
Keywords: encryption,cipher,cli,security
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security :: Cryptography
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ncr-cipher

**Production-grade NCR3 encryption tool** — a single `ncr` command available everywhere in the terminal after installation, on Windows, macOS, and Linux.

## Installation

```bash
pip install ncr-cipher
```

Or install from source:

```bash
pip install -e .
```

## Quick Start

```bash
# Generate a key file
ncr --keygen mykey.key

# Encrypt a file
ncr --lock secret.txt --key mykey.key

# Decrypt a file
ncr --unlock secret.txt.ncr3 --key mykey.key

# Verify integrity without decrypting
ncr --verify secret.txt.ncr3 --key mykey.key

# Show file info (no password needed)
ncr --info secret.txt.ncr3
```

## Commands

| Command | Description |
|---|---|
| `ncr --keygen <keyfile>` | Generate a new key file |
| `ncr --lock <file> --key <k>` | Encrypt a file |
| `ncr --unlock <file> --key <k>` | Decrypt a file |
| `ncr --verify <file> --key <k>` | Check HMAC without decrypting |
| `ncr --info <file>` | Show NCR version, IV, block count, file size |
| `ncr --bench` | Benchmark KDF time + encrypt speed |
| `ncr --test` | Run internal self-tests |
| `ncr --version` | Print version |

## Flags

| Flag | Description |
|---|---|
| `--out, -o <path>` | Output path override |
| `--inplace, -i` | Overwrite the original file |
| `--silent, -s` | No output except errors |
| `--force, -f` | Overwrite output without confirmation |
| `--strength <1-5>` | KDF strength preset (keygen only) |

## Cipher: NCR3

- **KDF**: scrypt with configurable strength (5 presets)
- **Per-byte key mixing**: BLAKE2b-derived per-position keys
- **CBC chaining**: HMAC-SHA3-256 stream + ciphertext feedback
- **Authentication**: HMAC-SHA3-256 over full ciphertext
- **Math core**: nCr (binomial coefficient) based encryption mod 2¹²⁷−1

Backwards compatible: can read NCR2 files (read-only).

## Requirements

- Python 3.9+
- **Zero external dependencies** — stdlib only

## License

MIT
