Skip to main content

saad-g

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

import saad_g

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

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

التثبيت

python -m pip install saad-g

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

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

SM3

import saad_g

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

SM4

import saad_g

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

ZUC

import saad_g

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

تنبيه أمني

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

الترخيص

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

Metadata

Release files for saad-g 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for saad-g 1.1.2
File Interpreter ABI Platform
saad_g-1.1.2-py3-none-any.whl Python 3 none any Details

Release files / saad_g-1.1.2-py3-none-any.whl

Download URL saad_g-1.1.2-py3-none-any.whl
Size 33.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd7de6458b4768478d9863ed2ec1bec5aa7f62185b6215b30668cc38da4b1812
BLAKE2b-256 checksum
How to use checksums
d78ca3fa9d8a0346d655772b3e4c94f4b1a7bba4d9e66f239d875eafd46a0cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.1.2 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page