Metadata-Version: 2.4
Name: saad-g
Version: 1.1.2
Summary: SAAD-branded distribution of pure-Python GM cryptographic algorithms
Author: SAAD
License: MIT License
        
        Copyright (c) 2023 ww-rm
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://pypi.org/project/saad-g/
Project-URL: Upstream, https://github.com/ww-rm/gmalg
Keywords: saad,cryptography,SM2,SM3,SM4,SM9,ZUC
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Security :: Cryptography
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.gmalg
Dynamic: license-file

# saad-g

حزمة Python باسم **saad_g** تعيد تقديم واجهة خوارزميات GM نفسها المتاحة في `gmalg`، مع اسم استيراد جديد:

```python
import saad_g
```

هذه الحزمة مبنية من المصدر المفتوح لمشروع `gmalg` المرخص بترخيص MIT. تم الاحتفاظ بملف الترخيص وإشعار حقوق المؤلف في `LICENSE.gmalg`. المصدر upstream هو:

<https://github.com/ww-rm/gmalg>

## التثبيت

```bash
python -m pip install saad-g
```

## الخوارزميات والواجهات

تتضمن الحزمة `ZUC` و`SM2` و`SM3` و`SM4` و`SM9` و`SM9KGC`، إضافة إلى `KEYXCHG_MODE` و`PC_MODE` ووحدات `utils` و`bcmode` وباقي الوحدات الداخلية اللازمة للتوافق.

### SM3

```python
import saad_g

sm3 = saad_g.SM3()
sm3.update(b"hello")
print(sm3.value().hex())
```

### SM4

```python
import saad_g

key = bytes.fromhex("0123456789ABCDEFFEDCBA9876543210")
sm4 = saad_g.SM4(key)
cipher = sm4.encrypt(b"0102030405060708")
print(sm4.decrypt(cipher))
```

### ZUC

```python
import saad_g

zuc = saad_g.ZUC(
    bytes.fromhex("3d4c4be96a82fdaeb58f641db17b455b"),
    bytes.fromhex("84319aa8de6915ca1f6bda6bfbd8c766"),
)
print(zuc.generate().hex())
```

## تنبيه أمني

هذه خوارزميات تشفير منخفضة المستوى. لا تستخدمها لحماية بيانات حقيقية قبل مراجعة مختص واختبار التوافق مع معيارك ومتطلبات إدارة المفاتيح. لا تضع المفاتيح السرية داخل الشفرة أو في مستودع عام، ولا تستخدم أمثلة المفاتيح المنشورة للإنتاج.

## الترخيص

هذا التوزيع يتضمن كود gmalg المرخص بترخيص MIT. راجع `LICENSE.gmalg` للتفاصيل الكاملة.
