Skip to main content

Simple use of RSA for asymmetric encryption and signature | 简单使用 rsa 进行非对称加密和签名

Project description

myrsa

Simple use of RSA for asymmetric encryption and signature

简单使用 rsa 进行非对称加密和签名

Installation

pip install myrsa

Usage:

import myrsa

pubkey, prikey = myrsa.newkeys()
print((pubkey, prikey))

message = 'Hello@世界'

crypto = myrsa.encrypt(message, pubkey)
print(crypto)

message = myrsa.decrypt(crypto, prikey)
print(message)

signature = myrsa.sign(message, prikey)
print(signature)

verified = myrsa.verify(message, signature, pubkey)
print(verified)

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

myrsa-0.0.1.tar.gz (2.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page