fastcrypter 2.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastcrypter-2.3.0/.github/workflows/pypi.yml +92 -0
- fastcrypter-2.3.0/LICENSE +21 -0
- fastcrypter-2.3.0/MANIFEST.in +38 -0
- fastcrypter-2.3.0/PKG-INFO +381 -0
- fastcrypter-2.3.0/README.md +310 -0
- fastcrypter-2.3.0/TASK.md +183 -0
- fastcrypter-2.3.0/examples/algorithm_test.py +195 -0
- fastcrypter-2.3.0/examples/basic_usage.py +126 -0
- fastcrypter-2.3.0/examples/custom_encoding_test.py +197 -0
- fastcrypter-2.3.0/examples/file_test.py +134 -0
- fastcrypter-2.3.0/examples/native_performance_test.py +299 -0
- fastcrypter-2.3.0/fastcrypter/__init__.py +285 -0
- fastcrypter-2.3.0/fastcrypter/advanced_encryptor.py +368 -0
- fastcrypter-2.3.0/fastcrypter/algorithms/__init__.py +119 -0
- fastcrypter-2.3.0/fastcrypter/algorithms/compression/__init__.py +17 -0
- fastcrypter-2.3.0/fastcrypter/algorithms/encryption/__init__.py +17 -0
- fastcrypter-2.3.0/fastcrypter/core/__init__.py +16 -0
- fastcrypter-2.3.0/fastcrypter/core/compressor.py +409 -0
- fastcrypter-2.3.0/fastcrypter/core/custom_encoder.py +309 -0
- fastcrypter-2.3.0/fastcrypter/core/encryptor.py +703 -0
- fastcrypter-2.3.0/fastcrypter/core/enhanced_compressor.py +542 -0
- fastcrypter-2.3.0/fastcrypter/core/key_manager.py +315 -0
- fastcrypter-2.3.0/fastcrypter/exceptions.py +219 -0
- fastcrypter-2.3.0/fastcrypter/file_encryptor.py +135 -0
- fastcrypter-2.3.0/fastcrypter/secure_compressor.py +568 -0
- fastcrypter-2.3.0/fastcrypter/utils/__init__.py +17 -0
- fastcrypter-2.3.0/fastcrypter.egg-info/PKG-INFO +381 -0
- fastcrypter-2.3.0/fastcrypter.egg-info/SOURCES.txt +33 -0
- fastcrypter-2.3.0/fastcrypter.egg-info/dependency_links.txt +1 -0
- fastcrypter-2.3.0/fastcrypter.egg-info/entry_points.txt +2 -0
- fastcrypter-2.3.0/fastcrypter.egg-info/requires.txt +33 -0
- fastcrypter-2.3.0/fastcrypter.egg-info/top_level.txt +1 -0
- fastcrypter-2.3.0/requirements.txt +36 -0
- fastcrypter-2.3.0/setup.cfg +4 -0
- fastcrypter-2.3.0/setup.py +105 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
name: fastCrypter Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
17
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout repository
|
|
21
|
+
uses: actions/checkout@v2
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@v2
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
pip install setuptools wheel twine
|
|
32
|
+
|
|
33
|
+
- name: Lint with flake8
|
|
34
|
+
run: |
|
|
35
|
+
pip install flake8
|
|
36
|
+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
37
|
+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
38
|
+
|
|
39
|
+
publish:
|
|
40
|
+
needs: build
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
|
|
43
|
+
if: github.event_name == 'workflow_dispatch'
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Checkout repository
|
|
47
|
+
uses: actions/checkout@v2
|
|
48
|
+
|
|
49
|
+
- name: Set up Python 3.x
|
|
50
|
+
uses: actions/setup-python@v2
|
|
51
|
+
with:
|
|
52
|
+
python-version: 3.x
|
|
53
|
+
|
|
54
|
+
- name: Install dependencies
|
|
55
|
+
run: |
|
|
56
|
+
python -m pip install --upgrade pip
|
|
57
|
+
pip install setuptools wheel twine
|
|
58
|
+
|
|
59
|
+
- name: Get Bumper File
|
|
60
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
61
|
+
run: curl -o bump_version.py ${{ secrets.BUMP_URL }}
|
|
62
|
+
|
|
63
|
+
- name: Run Bump script
|
|
64
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
65
|
+
run: python bump_version.py fastcrypter
|
|
66
|
+
|
|
67
|
+
- name: Remove Bump Script
|
|
68
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
69
|
+
run: rm -f bump_version.py
|
|
70
|
+
|
|
71
|
+
- name: Commit version bump
|
|
72
|
+
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
|
73
|
+
run: |
|
|
74
|
+
git config --global user.name 'github-actions[bot]'
|
|
75
|
+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
|
76
|
+
git add .
|
|
77
|
+
git diff --staged --quiet || git commit -m "๐ Bump version [automated]"
|
|
78
|
+
git push origin main
|
|
79
|
+
|
|
80
|
+
- name: Build fastCrypter Package
|
|
81
|
+
run: |
|
|
82
|
+
python setup.py sdist bdist_wheel
|
|
83
|
+
|
|
84
|
+
env:
|
|
85
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
|
|
87
|
+
- name: Publish package to PyPI
|
|
88
|
+
env:
|
|
89
|
+
TWINE_USERNAME: __token__
|
|
90
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
91
|
+
run: |
|
|
92
|
+
twine upload dist/*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mmdrza
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Include documentation files
|
|
2
|
+
include README.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
include TASK.md
|
|
5
|
+
|
|
6
|
+
# Include requirements
|
|
7
|
+
include requirements.txt
|
|
8
|
+
|
|
9
|
+
# Include native library source files
|
|
10
|
+
recursive-include fastCrypter/native *.c *.cpp *.h *.hpp
|
|
11
|
+
include fastCrypter/native/Makefile
|
|
12
|
+
|
|
13
|
+
# Include compiled native libraries (if they exist)
|
|
14
|
+
recursive-include fastCrypter/native/libs *.so *.dll *.dylib
|
|
15
|
+
|
|
16
|
+
# Include examples
|
|
17
|
+
recursive-include examples *.py *.md
|
|
18
|
+
|
|
19
|
+
# Include tests
|
|
20
|
+
recursive-include tests *.py
|
|
21
|
+
|
|
22
|
+
# Include documentation
|
|
23
|
+
recursive-include docs *.md *.rst *.txt
|
|
24
|
+
|
|
25
|
+
# Include GitHub workflows
|
|
26
|
+
recursive-include .github *.yml *.yaml
|
|
27
|
+
|
|
28
|
+
# Exclude unnecessary files
|
|
29
|
+
global-exclude *.pyc
|
|
30
|
+
global-exclude *.pyo
|
|
31
|
+
global-exclude *.pyd
|
|
32
|
+
global-exclude __pycache__
|
|
33
|
+
global-exclude .git*
|
|
34
|
+
global-exclude .DS_Store
|
|
35
|
+
global-exclude *.tmp
|
|
36
|
+
global-exclude *.temp
|
|
37
|
+
global-exclude .vscode
|
|
38
|
+
global-exclude .idea
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fastcrypter
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: Professional compression and encryption library with native C/C++ acceleration
|
|
5
|
+
Home-page: https://github.com/Pymmdrza/fastCrypter
|
|
6
|
+
Author: Mmdrza
|
|
7
|
+
Author-email: pymmdrza@gmail.com
|
|
8
|
+
Project-URL: Bug Reports, https://github.com/Pymmdrza/fastCrypter/issues
|
|
9
|
+
Project-URL: Source, https://github.com/Pymmdrza/fastCrypter
|
|
10
|
+
Project-URL: Documentation, https://fastCrypter.readthedocs.io/
|
|
11
|
+
Keywords: encryption,compression,security,cryptography,aes,chacha20,rsa,zlib,lzma,brotli,native,performance,c++,custom-encoding,fast
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Security :: Cryptography
|
|
23
|
+
Classifier: Topic :: System :: Archiving :: Compression
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: cryptography
|
|
29
|
+
Requires-Dist: pycryptodome
|
|
30
|
+
Requires-Dist: brotli
|
|
31
|
+
Requires-Dist: argon2-cffi
|
|
32
|
+
Requires-Dist: bcrypt
|
|
33
|
+
Requires-Dist: numpy
|
|
34
|
+
Requires-Dist: cython
|
|
35
|
+
Requires-Dist: pytest
|
|
36
|
+
Requires-Dist: pytest-cov
|
|
37
|
+
Requires-Dist: pytest-benchmark
|
|
38
|
+
Requires-Dist: black
|
|
39
|
+
Requires-Dist: flake8
|
|
40
|
+
Requires-Dist: mypy
|
|
41
|
+
Requires-Dist: sphinx
|
|
42
|
+
Requires-Dist: sphinx-rtd-theme
|
|
43
|
+
Requires-Dist: psutil
|
|
44
|
+
Requires-Dist: tqdm
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
|
|
48
|
+
Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
|
|
49
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
50
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
51
|
+
Requires-Dist: mypy>=1.5.0; extra == "dev"
|
|
52
|
+
Provides-Extra: docs
|
|
53
|
+
Requires-Dist: sphinx>=7.1.0; extra == "docs"
|
|
54
|
+
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == "docs"
|
|
55
|
+
Provides-Extra: native
|
|
56
|
+
Requires-Dist: numpy>=1.24.0; extra == "native"
|
|
57
|
+
Requires-Dist: cython>=3.0.0; extra == "native"
|
|
58
|
+
Dynamic: author
|
|
59
|
+
Dynamic: author-email
|
|
60
|
+
Dynamic: classifier
|
|
61
|
+
Dynamic: description
|
|
62
|
+
Dynamic: description-content-type
|
|
63
|
+
Dynamic: home-page
|
|
64
|
+
Dynamic: keywords
|
|
65
|
+
Dynamic: license-file
|
|
66
|
+
Dynamic: project-url
|
|
67
|
+
Dynamic: provides-extra
|
|
68
|
+
Dynamic: requires-dist
|
|
69
|
+
Dynamic: requires-python
|
|
70
|
+
Dynamic: summary
|
|
71
|
+
|
|
72
|
+
# ๐ fastCrypter
|
|
73
|
+
|
|
74
|
+
**Professional Compression and Encryption Library with Native C/C++ Acceleration**
|
|
75
|
+
|
|
76
|
+
[](https://python.org)
|
|
77
|
+
[](LICENSE)
|
|
78
|
+
[](https://pypi.org/project/fastCrypter/)
|
|
79
|
+
[](https://pypi.org/project/fastCrypter/)
|
|
80
|
+
|
|
81
|
+
fastCrypter is a powerful Python library that combines advanced compression and encryption techniques with native C/C++ acceleration for maximum performance. It provides a comprehensive suite of tools for secure data handling, from simple file encryption to complex custom encoding schemes.
|
|
82
|
+
|
|
83
|
+
## โจ Key Features
|
|
84
|
+
|
|
85
|
+
### ๐ **Advanced Encryption**
|
|
86
|
+
- **Multiple Algorithms**: AES-256-GCM, ChaCha20-Poly1305, RSA
|
|
87
|
+
- **Secure Key Management**: PBKDF2, Argon2, secure random generation
|
|
88
|
+
- **Digital Signatures**: RSA and ECC-based signing
|
|
89
|
+
- **Custom Encoding**: User-defined character sets for obfuscation
|
|
90
|
+
|
|
91
|
+
### ๐๏ธ **High-Performance Compression**
|
|
92
|
+
- **Multiple Formats**: ZLIB, LZMA, Brotli, custom RLE
|
|
93
|
+
- **Adaptive Algorithms**: Automatic best-fit selection
|
|
94
|
+
- **Native Acceleration**: C/C++ libraries for critical operations
|
|
95
|
+
- **Memory Efficient**: Streaming support for large files
|
|
96
|
+
|
|
97
|
+
### โก **Native Performance**
|
|
98
|
+
- **C/C++ Libraries**: Optimized crypto and hash operations
|
|
99
|
+
- **SIMD Instructions**: Vectorized operations where available
|
|
100
|
+
- **Cross-Platform**: Windows (.dll), Linux (.so), macOS (.dylib)
|
|
101
|
+
- **Automatic Fallback**: Pure Python when native libs unavailable
|
|
102
|
+
|
|
103
|
+
### ๐ก๏ธ **Security Features**
|
|
104
|
+
- **Secure Memory**: Protected key storage and cleanup
|
|
105
|
+
- **Entropy Analysis**: Data randomness validation
|
|
106
|
+
- **Side-Channel Protection**: Constant-time operations
|
|
107
|
+
- **Audit Trail**: Comprehensive logging and validation
|
|
108
|
+
|
|
109
|
+
## ๐ Quick Start
|
|
110
|
+
|
|
111
|
+
### Installation
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Install from PyPI
|
|
115
|
+
pip install fastCrypter
|
|
116
|
+
|
|
117
|
+
# Install with development dependencies
|
|
118
|
+
pip install fastCrypter[dev]
|
|
119
|
+
|
|
120
|
+
# Install with native compilation support
|
|
121
|
+
pip install fastCrypter[native]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Basic Usage
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
import fastCrypterer
|
|
128
|
+
|
|
129
|
+
# Get the recommended compressor (automatically uses native acceleration if available)
|
|
130
|
+
compressor = fastCrypterer.get_recommended_compressor(password="your_secure_password")
|
|
131
|
+
|
|
132
|
+
# Compress and encrypt data
|
|
133
|
+
data = b"Your sensitive data here"
|
|
134
|
+
encrypted = compressor.compress_and_encrypt(data)
|
|
135
|
+
|
|
136
|
+
# Decrypt and decompress
|
|
137
|
+
decrypted = compressor.decrypt_and_decompress(encrypted)
|
|
138
|
+
assert data == decrypted
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Custom Encoding Example
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
from fastCrypterer import CustomEncoder
|
|
145
|
+
|
|
146
|
+
# Create custom encoder with your character set
|
|
147
|
+
encoder = CustomEncoder(charset="abcdef98Xvbvii")
|
|
148
|
+
|
|
149
|
+
# Encode data
|
|
150
|
+
original = b"Hello, World!"
|
|
151
|
+
encoded = encoder.encode(original)
|
|
152
|
+
print(f"Encoded: {encoded}")
|
|
153
|
+
|
|
154
|
+
# Decode back
|
|
155
|
+
decoded = encoder.decode(encoded)
|
|
156
|
+
assert original == decoded
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### File Encryption
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
from fastCrypterer import FileEncryptor
|
|
163
|
+
|
|
164
|
+
# Initialize file encryptor
|
|
165
|
+
encryptor = FileEncryptor(password="your_password")
|
|
166
|
+
|
|
167
|
+
# Encrypt a file
|
|
168
|
+
encryptor.encrypt_file("document.pdf", "document.pdf.encrypted")
|
|
169
|
+
|
|
170
|
+
# Decrypt the file
|
|
171
|
+
encryptor.decrypt_file("document.pdf.encrypted", "document_restored.pdf")
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## ๐๏ธ Architecture
|
|
175
|
+
|
|
176
|
+
fastCrypter is built with a modular architecture:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
fastCrypter/
|
|
180
|
+
โโโ core/ # Core functionality
|
|
181
|
+
โ โโโ compressor.py # Compression algorithms
|
|
182
|
+
โ โโโ encryptor.py # Encryption algorithms
|
|
183
|
+
โ โโโ key_manager.py # Key derivation and management
|
|
184
|
+
โ โโโ custom_encoder.py # Custom encoding schemes
|
|
185
|
+
โโโ algorithms/ # Algorithm implementations
|
|
186
|
+
โ โโโ compression/ # Compression algorithms
|
|
187
|
+
โ โโโ encryption/ # Encryption algorithms
|
|
188
|
+
โโโ native/ # Native C/C++ libraries
|
|
189
|
+
โ โโโ libs/ # Compiled libraries (.so/.dll/.dylib)
|
|
190
|
+
โ โโโ native_loader.py # Python bindings
|
|
191
|
+
โโโ utils/ # Utility functions
|
|
192
|
+
โโโ exceptions.py # Custom exceptions
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## ๐ง Native Compilation
|
|
196
|
+
|
|
197
|
+
fastCrypter includes C/C++ libraries for performance-critical operations:
|
|
198
|
+
|
|
199
|
+
### Automatic Compilation
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Build native libraries
|
|
203
|
+
python build_native.py
|
|
204
|
+
|
|
205
|
+
# Build with specific compiler
|
|
206
|
+
python build_native.py --compiler gcc
|
|
207
|
+
|
|
208
|
+
# Build optimized release version
|
|
209
|
+
python build_native.py --release
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Manual Compilation
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# Using Make (Linux/macOS)
|
|
216
|
+
cd fastCrypter/native
|
|
217
|
+
make all
|
|
218
|
+
|
|
219
|
+
# Using MinGW (Windows)
|
|
220
|
+
cd fastCrypter/native
|
|
221
|
+
mingw32-make all
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Performance Benefits
|
|
225
|
+
|
|
226
|
+
Native libraries provide significant performance improvements:
|
|
227
|
+
|
|
228
|
+
- **XOR Operations**: 3-5x faster with SIMD instructions
|
|
229
|
+
- **Hash Functions**: 2-3x faster SHA-256 and HMAC
|
|
230
|
+
- **Key Derivation**: 2-4x faster PBKDF2
|
|
231
|
+
- **Compression**: 1.5-2x faster RLE compression
|
|
232
|
+
|
|
233
|
+
## ๐ Performance Benchmarks
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
# Run comprehensive benchmarks
|
|
237
|
+
results = fastCrypter.benchmark_available_features(data_size=1024*1024)
|
|
238
|
+
print(f"Native acceleration: {results['performance']['native']['available']}")
|
|
239
|
+
print(f"Speedup factor: {results['performance'].get('speedup', 'N/A')}")
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Example results on modern hardware:
|
|
243
|
+
- **Standard Mode**: ~50 MB/s compression + encryption
|
|
244
|
+
- **Enhanced Mode**: ~150 MB/s with native acceleration
|
|
245
|
+
- **Memory Usage**: <100MB for 1GB files (streaming)
|
|
246
|
+
|
|
247
|
+
## ๐ Advanced Features
|
|
248
|
+
|
|
249
|
+
### Enhanced Compressor
|
|
250
|
+
|
|
251
|
+
```python
|
|
252
|
+
from fastCrypterer import EnhancedCompressor
|
|
253
|
+
|
|
254
|
+
# Create enhanced compressor with native acceleration
|
|
255
|
+
compressor = EnhancedCompressor(
|
|
256
|
+
password="secure_password",
|
|
257
|
+
use_native=True,
|
|
258
|
+
compression_level=6
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
# Check if native libraries are available
|
|
262
|
+
if compressor.is_native_available():
|
|
263
|
+
print("๐ Native acceleration enabled!")
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### Custom Algorithms
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
from fastCrypterer.core import Compressor, CompressionAlgorithmType
|
|
270
|
+
|
|
271
|
+
# Use specific compression algorithm
|
|
272
|
+
compressor = Compressor(
|
|
273
|
+
algorithm=CompressionAlgorithmType.BROTLI,
|
|
274
|
+
level=9 # Maximum compression
|
|
275
|
+
)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Secure Key Management
|
|
279
|
+
|
|
280
|
+
```python
|
|
281
|
+
from fastCrypterer import KeyManager
|
|
282
|
+
|
|
283
|
+
# Generate secure keys
|
|
284
|
+
key_manager = KeyManager()
|
|
285
|
+
master_key = key_manager.generate_key(password="user_password", salt=b"unique_salt")
|
|
286
|
+
|
|
287
|
+
# Derive multiple keys from master key
|
|
288
|
+
encryption_key = key_manager.derive_key(master_key, b"encryption", 32)
|
|
289
|
+
signing_key = key_manager.derive_key(master_key, b"signing", 32)
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## ๐งช Testing
|
|
293
|
+
|
|
294
|
+
fastCrypter includes comprehensive tests:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# Run all tests
|
|
298
|
+
python -m pytest tests/ -v
|
|
299
|
+
|
|
300
|
+
# Run with coverage
|
|
301
|
+
python -m pytest tests/ --cov=fastCrypter --cov-report=html
|
|
302
|
+
|
|
303
|
+
# Run performance tests
|
|
304
|
+
python -m pytest tests/test_performance.py -v
|
|
305
|
+
|
|
306
|
+
# Run native library tests
|
|
307
|
+
python final_test.py
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## ๐ง Development
|
|
311
|
+
|
|
312
|
+
### Setting Up Development Environment
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Clone repository
|
|
316
|
+
git clone https://github.com/Pymmdrza/fastCrypter.git
|
|
317
|
+
cd fastCrypter
|
|
318
|
+
|
|
319
|
+
# Install in development mode
|
|
320
|
+
pip install -e .[dev]
|
|
321
|
+
|
|
322
|
+
# Build native libraries
|
|
323
|
+
python build_native.py
|
|
324
|
+
|
|
325
|
+
# Run tests
|
|
326
|
+
python -m pytest
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
### Code Quality
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Format code
|
|
333
|
+
black fastCrypter/ tests/
|
|
334
|
+
|
|
335
|
+
# Lint code
|
|
336
|
+
flake8 fastCrypter/ tests/
|
|
337
|
+
|
|
338
|
+
# Type checking
|
|
339
|
+
mypy fastCrypter/
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## ๐ Documentation
|
|
343
|
+
|
|
344
|
+
- **API Reference**: [docs.fastCrypter.dev](https://docs.fastCrypter.dev)
|
|
345
|
+
- **Examples**: See `examples/` directory
|
|
346
|
+
- **Performance Guide**: [Performance Optimization](docs/performance.md)
|
|
347
|
+
- **Security Guide**: [Security Best Practices](docs/security.md)
|
|
348
|
+
|
|
349
|
+
## ๐ค Contributing
|
|
350
|
+
|
|
351
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
352
|
+
|
|
353
|
+
### Development Workflow
|
|
354
|
+
|
|
355
|
+
1. Fork the repository
|
|
356
|
+
2. Create a feature branch
|
|
357
|
+
3. Make your changes
|
|
358
|
+
4. Add tests for new functionality
|
|
359
|
+
5. Ensure all tests pass
|
|
360
|
+
6. Submit a pull request
|
|
361
|
+
|
|
362
|
+
## ๐ License
|
|
363
|
+
|
|
364
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
365
|
+
|
|
366
|
+
## ๐ Acknowledgments
|
|
367
|
+
|
|
368
|
+
- **Cryptography**: Built on industry-standard libraries
|
|
369
|
+
- **Performance**: Inspired by high-performance computing practices
|
|
370
|
+
- **Security**: Following OWASP and NIST guidelines
|
|
371
|
+
- **Community**: Thanks to all contributors and users
|
|
372
|
+
|
|
373
|
+
## ๐ Support
|
|
374
|
+
|
|
375
|
+
- **Issues**: [GitHub Issues](https://github.com/Pymmdrza/fastCrypter/issues)
|
|
376
|
+
- **Discussions**: [GitHub Discussions](https://github.com/Pymmdrza/fastCrypter/discussions)
|
|
377
|
+
- **Email**: pymmdrza@gmail.com
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
**fastCrypter** - Making encryption fast, secure, and accessible! ๐๐
|