Skip to main content

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


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.1.0.tar.gz (64.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

RealRsa-0.1.0-cp312-cp312-win_amd64.whl (33.2 kB view details)

Uploaded CPython 3.12Windows x86-64

RealRsa-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

RealRsa-0.1.0-cp311-cp311-win_amd64.whl (33.0 kB view details)

Uploaded CPython 3.11Windows x86-64

RealRsa-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

RealRsa-0.1.0-cp310-cp310-win_amd64.whl (33.0 kB view details)

Uploaded CPython 3.10Windows x86-64

RealRsa-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

RealRsa-0.1.0-cp39-cp39-win_amd64.whl (33.5 kB view details)

Uploaded CPython 3.9Windows x86-64

RealRsa-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

RealRsa-0.1.0-cp38-cp38-win_amd64.whl (33.7 kB view details)

Uploaded CPython 3.8Windows x86-64

RealRsa-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

Details for the file realrsa-0.1.0.tar.gz.

File metadata

  • Download URL: realrsa-0.1.0.tar.gz
  • Upload date:
  • Size: 64.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for realrsa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a9a456cbc33f98632d94eba43c592e2eaeb776e763d28ec08f4d14472d661a05
MD5 9ecf23bda6e56b8838ce73d8e022a6db
BLAKE2b-256 77ed4e81db0391babac6f5e402992d1ce4fc8f76afd368999df5f5fd8f3ddf3c

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: RealRsa-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 33.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for RealRsa-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3ccd1f33781c0057adbeebd415fb8fcd8cba0c31c386f8487b63faa3f0a6eb16
MD5 35af1b17a7e6d3a60dcb86f9d621af02
BLAKE2b-256 8a7ba21b9027fa627e63cdcbe2eb5d3f7d99bd62f180ac90d524cc2e6f80e7b7

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for RealRsa-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4da6cb3a675956eb2d52d3df52d4f6d059d96fe58e03d39351b8db3ef09a2eb0
MD5 a68aaaaae9c9fc16aca87f102b1301bb
BLAKE2b-256 d3aba5eeac416db2b34690fdb36df3f07e2bfd039c964be0f38732a0e4054e27

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: RealRsa-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for RealRsa-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fe34de8d78a705680edf4bb840a990faaebbcba8a8c541a2249c456832340be8
MD5 d56511247427cfcdd1adf99832fccf86
BLAKE2b-256 a44e2af4df7f4c1b73b4dc0570b05cbad50582dcabc5d60dc5bf37b27b0a2b71

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for RealRsa-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ecea1ac76927bce29d31355652fdef5c08d143b60fd2a4acbb77bf29f600fa25
MD5 d5e9781154c06b6235c20f0809e9b536
BLAKE2b-256 9f84081eb08eb1f9968313e018b969eb732e855b35f165b5ee9a6542ba6e0c58

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: RealRsa-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 33.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for RealRsa-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4ab39beb7315bf30c27955f44f0b1d538670fc43630b24807243733be9dd00e5
MD5 6dfaa5898e0847b98d19bd94067c0355
BLAKE2b-256 60d845539dbedba05856bc783d28acd9e1728c89801c2c7da6a1c08e140843ce

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for RealRsa-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c0c6512a13a7d4ebb079721a21ec338046de4e20e7bdb742611bcb3852434c24
MD5 55d37771a66bbfd1fff8c2004398a548
BLAKE2b-256 229c15ec4065316c7aed48318382874767bf4d1453b63515106a75cf4ca56d42

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: RealRsa-0.1.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for RealRsa-0.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 eaee469a63bddaeebe1e7752563dbf4f526ac9512cad349eb3b669b85309892d
MD5 7b5f0c9d6ebcbe1d3cb67d107086e6bc
BLAKE2b-256 44948f8eb730d46ccca858c48d02157eeaaac6d037ca58d9f8e7479a8113ab10

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for RealRsa-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 272f753434066417d541f868edb3408f184b7d047cd4646b8bdc74e159a851e8
MD5 305e9ab8a3ed233408f16e4bea72c60f
BLAKE2b-256 c9d790c268e959f025bc7e1faea9b741bdb0a8d537e9477a91f33d38f95a0134

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: RealRsa-0.1.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for RealRsa-0.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d46a1fd4f505960443ce795df7509332ae54940ecdb59e9bbaea1b3bdc113f8e
MD5 519f3c841d771a4d0864b93de90db44f
BLAKE2b-256 40b4715b32cf34d42e1a435c36ae5e1f35fb7f29e36a7cb485ea854e3f139a8c

See more details on using hashes here.

File details

Details for the file RealRsa-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for RealRsa-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4da0ef867c63b6a39f6d38cccf8f79df1cc99817a29e5bb52c1530fe22c96cbe
MD5 d8650904174477e1ee6b5042ba3b7f7b
BLAKE2b-256 0e18034108811553805dd72d400c8db2a3de346774d00e0662f59aad1c944bc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page