Python-RSA implements encryption and signatures according to PKCS#1 version 1.5. This makes it compatible with the OpenSSL RSA module.
Keys are stored in PEM or DER format according to PKCS#1 v1.5. Private keys are compatible with OpenSSL. However, OpenSSL uses X.509 for its public keys, which are not supported.
You can create a 512-bit RSA key in OpenSSL as follows:
openssl genrsa -out myprivatekey.pem 512
To get a Python-RSA-compatible public key from OpenSSL, you need the private key first, then run it through the pyrsa-priv2pub command:
pyrsa-priv2pub -i myprivatekey.pem -o mypublickey.pem
Encryption and decryption is also compatible:
$ echo hello there > testfile.txt
$ pyrsa-encrypt -i testfile.txt -o testfile.rsa publickey.pem
$ openssl rsautl -in testfile.rsa -inkey privatekey.pem -decrypt
hello there