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 and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page