Skip to main content

No project description provided

Project description

description

python不支持rsa是私钥加密,golang编译成so文件,让python调用: 
python does not support rsa as a private key encryption, 
golang is compiled into a so file for python to call

build

go build -ldflags "-s -w" -buildmode=c-shared -o ./rsa_so/bin/rsa_darwin_arm.so ./go/main.go

quick start

  1. install rsa-so packe
pip install rsa-so
  1. encrypt data
import base64
from rsa_so import sign

# Replace it with your own private key
private_key = """-----BEGIN RSA PRIVATE KEY-----
ABCD.....FGHI
-----END RSA PRIVATE KEY-----"""
data_bytes = private_key.encode('utf-8')
# Base64 encode
encrypted_data = base64.b64encode(data_bytes).decode('utf-8')
sign.encrypt_by_rsa_private_key('hello,word!!', encrypted_data)

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

rsa_so-0.1.3.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

rsa_so-0.1.3-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file rsa_so-0.1.3.tar.gz.

File metadata

  • Download URL: rsa_so-0.1.3.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/23.5.0

File hashes

Hashes for rsa_so-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8b4d23efaf9e10cc97714a40031b0df75d3b0f668fd58d6e0e2e40c9acfd1024
MD5 986970339ac31e80aab85e7b09902386
BLAKE2b-256 de34f7e82a182aaa5f0bcb7a23730b790b5903ed459863ec02411fdf90d3be9d

See more details on using hashes here.

File details

Details for the file rsa_so-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: rsa_so-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/23.5.0

File hashes

Hashes for rsa_so-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff435b3cee53adefa726b3d0b49d79f98fb8c10a681a141f9b115bc78c8f0323
MD5 972c39c718d0114b6bff77f21075d9e2
BLAKE2b-256 620441f452e1f7ee8dab1986500194f50d303583baae7c5ced1f3bb0528a0982

See more details on using hashes here.

Supported by

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