Metadata-Version: 2.4
Name: cryptography-tlvm
Version: 2.4.0
Summary: Advanced file encryptor/decryptor with AES-256-GCM, seal footer, inspection and audit tools
Author: TLVM
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: cryptography>=42.0.0

# Cipher Shield

`cipher-shield` là bộ mã hoá/giải mã, phân tích và kiểm tra độ đầy đủ source dùng:

- AES-256-GCM
- PBKDF2-HMAC-SHA256
- ZLIB
- CUTC text envelope (Base64)
- Seal mode: gắn footer kiểm tra toàn vẹn 1 dòng
- Phân tích cấu trúc file chuyên sâu
- So sánh 2 file theo hash / entropy / byte đầu tiên khác nhau
- Audit source tree để kiểm tra độ đầy đủ của code

## Cài như một gói pip

```bash
pip install .
```

Cài ở chế độ dev:

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

Build wheel:

```bash
python -m pip install build
python -m build
```

## Dùng CLI

Mã hoá:

```bash
cipher-shield input.bin
cipher-shield input.bin output.ec --seal
cipher-shield input.bin output.cutc --cutc
cipher-shield input.bin output.enc --password "matkhau"
```

Giải mã:

```bash
cipher-shield -dc input.ec
cipher-shield -dc input.cutc
cipher-shield -dc input.enc output.bin
```

Phân tích cấu trúc file:

```bash
cipher-shield --inspect input.bin
cipher-shield --inspect input.cutc --json
cipher-shield --inspect input.bin --report report.json
```

So sánh 2 file:

```bash
cipher-shield --compare other.bin input.bin
cipher-shield --compare other.bin input.bin --json
```

Audit source:

```bash
cipher-shield --audit .
cipher-shield --audit /path/to/source --json
```

## Tuỳ chọn chính

- `-h`, `--help`, `-help`: trợ giúp
- `-dc`: giải mã
- `-en`: mã hóa
- `--cutc`: xuất ra CUTC text
- `--seal`: bật footer kiểm tra toàn vẹn 1 dòng
- `--cutc-style`: chọn kiểu banner
- `--cre TLVM`: hiển thị credit trong banner / metadata
- `--deep`: bật chế độ kiểm tra bảo mật chặt hơn
- `-p`, `--password`: truyền mật khẩu
- `-k`, `--key-file`: đọc mật khẩu từ file text
- `-f`: ghi đè file đầu ra
- `-rm`: xoá file gốc sau khi xử lý
- `--dry-run`: chạy thử, không ghi file
- `--inspect`: phân tích file
- `--compare FILE`: so sánh file đầu vào với một file khác
- `--audit [PATH]`: kiểm tra độ đầy đủ của source
- `--json`: xuất báo cáo JSON
- `--report PATH`: lưu báo cáo ra file

## Ghi chú

- Seal mode dùng key gốc để mã hoá file, đồng thời dùng SHA-256 của key để khoá footer kiểm tra hash của file đã mã hoá.
- Header được ràng buộc bằng AAD của AES-GCM để phát hiện sửa đổi.
- Phân tích file sẽ nhận diện: CUTC text, payload binary, độ entropy, hash SHA-256 / MD5 và byte khác nhau đầu tiên khi so sánh.
