python version of rsa
Project description
Python RSA加解密封装
解除只能用公钥加密的限制
示例
from RealRsa import Rsa
pyrsa = Rsa()
pub_key = """
-----BEGIN RSA PUBLIC KEY-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END RSA PUBLIC KEY-----
"""
data = "1bff1dfb66a599777dfe4d5edad268d41866e8f82d9604d6b750e2106b292cf2e11690420f515c3fe06d5fe851dc977e1eb3f0f610881659cb8fbf78e3e0dbc260dd7876146fc2b0e24a059fdf4d9540e8b1f9f755006085f491980248c345da03ff50edb77561bc5a304dc9ab658540cfbed4ebf828a351058abe7af508d5a19fa8dce65955d4f535618cba8fa115454fac166bf53784d51f319a56e3de071d766bda8c1683a74f10c9ee873daa710d233b53bcf8cbf7e0f9e48c13d9a1096ee3971c7c35b1b4bf4a4c6cdb4518c75147d5a21ed17fe161075baad4512ab3d4cf994f1bd5ca983fbf255f65b6a5d321ed68999cbff9b7e1b5dc9fc358d7a247"
ret = pyrsa.pub_decrypt(bytes.fromhex(data), pub_key)
print(ret)
ret = pyrsa.pub_encrypt("23342321",pub_key)
print(ret)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
realrsa-0.0.7.tar.gz
(59.9 kB
view details)
Built Distribution
File details
Details for the file realrsa-0.0.7.tar.gz
.
File metadata
- Download URL: realrsa-0.0.7.tar.gz
- Upload date:
- Size: 59.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b316f9e9e769521d295516dacc0f269bedc472ae69778a036020e1d11cd7877 |
|
MD5 | 566c1c2990df0a927baed4cbf0b0ad8b |
|
BLAKE2b-256 | 4d6d3e25da5994535b116461e0412122bf7c2b64d2b0f15cbef54c69e38fc412 |
File details
Details for the file RealRsa-0.0.7-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: RealRsa-0.0.7-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 29.7 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 571d3ef62e3bb73591b00e512c0ef489d0df6b5d5bdee2e50dc2dd8e380978c0 |
|
MD5 | 8dbf618ffe5157d308d05a144e3cad17 |
|
BLAKE2b-256 | d62745aea4b8bf2c90ce914c4321c499a50cf494f27a5164041c44d5201044e1 |