lesscode_encryption是基于Rust语言开发的加密算法库
Project description
lesscode_encryption
lesscode_encryption是基于Rust语言开发的加密算法库
# sm2
from lesscode_encryption import LessCodeEncryption
key = LessCodeEncryption.sm2_gen_keypair()
origin_str = "hello navysummer"
sm2_encrypt_str = LessCodeEncryption.sm2_encrypt(key.pk, origin_str)
sm2_decrypt_str = LessCodeEncryption.sm2_decrypt(key.sk, sm2_encrypt_str)
assert sm2_decrypt_str == origin_str
# sm3
sm3_str = LessCodeEncryption.sm3_hex(origin_str)
# sm4
key = "8A3F8665AAEE6F7A0CB8F40B971E3373"
iv = "88BA27B390F466ABE7C4327E1E60270B"
sm4_ecb_encrypt_str = LessCodeEncryption.sm4_encrypt("ecb", origin_str, key)
sm4_ecb_decrypt_str = LessCodeEncryption.sm4_decrypt("ecb", sm4_ecb_encrypt_str, key)
assert sm4_ecb_decrypt_str == origin_str
sm4_cbc_encrypt_str = LessCodeEncryption.sm4_encrypt("cbc", origin_str, key, iv)
sm4_cbc_decrypt_str = LessCodeEncryption.sm4_decrypt("cbc", sm4_cbc_encrypt_str, key, iv)
assert sm4_cbc_decrypt_str == origin_str
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file lesscode_encryption-0.0.2.tar.gz
.
File metadata
- Download URL: lesscode_encryption-0.0.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a27d226238db1ac6f2208e891d79b192a90b9efde74a36d2bbfc80b0560e8bca |
|
MD5 | 91b12b4bdbb66fe50c0f58dc8951e635 |
|
BLAKE2b-256 | 1be1e4e83131c0be88e1915314d98b99ca321ca155e13ea8ac2614e741011cdc |
File details
Details for the file lesscode_encryption-0.0.2-cp39-none-win_amd64.whl
.
File metadata
- Download URL: lesscode_encryption-0.0.2-cp39-none-win_amd64.whl
- Upload date:
- Size: 267.6 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c229186e898bf7b73e88307053653093cc8a380493a21b60fe71464ce3001cd1 |
|
MD5 | 37198d1ee99be1a4fc3a2ae40f0b5fa7 |
|
BLAKE2b-256 | 87c061c909e720a3739bb27b8ad1e96d388ecedbb16ee2b62a6f4b6cf3283908 |
File details
Details for the file lesscode_encryption-0.0.2-cp38-none-win_amd64.whl
.
File metadata
- Download URL: lesscode_encryption-0.0.2-cp38-none-win_amd64.whl
- Upload date:
- Size: 267.6 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18bebd95dada6d3b8c96a7d9214ebfa7f89d2262e99773376f45558c3a1a7205 |
|
MD5 | f82e740e6b2f52dea8e50a8cd79af037 |
|
BLAKE2b-256 | 41a19799a2a8e8ba5c064b0bd3888726042c852c73c0da6b7f6141e6d4d9f042 |
File details
Details for the file lesscode_encryption-0.0.2-cp37-none-win_amd64.whl
.
File metadata
- Download URL: lesscode_encryption-0.0.2-cp37-none-win_amd64.whl
- Upload date:
- Size: 267.5 kB
- Tags: CPython 3.7, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d406b37d24c8220ad60e7b027d2a8748d267d91e73a0d251a6aee8f60a0df74 |
|
MD5 | d4fe85955220bd03d10ab1b398a7e6cb |
|
BLAKE2b-256 | e8babbdfd53c326c6647bd869bdba211224cff29abf9826c8d72b67dad867009 |