Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
公開鍵で文字列をエンコードする方法はありますか?
pycryptoとm2cryptoの2つのパッケージが見つかりました。しかし、私はそれらの使い方を見つけることができません。
公開鍵を使用して文字列をエンコードするには:
#!/usr/bin/env python from M2Crypto import RSA, X509 x509 = X509.load_cert("recipient_cert.pem") rsa = x509.get_pubkey().get_rsa() print rsa.public_encrypt("your string to encrypt", RSA.pkcs1_oaep_padding)