from Crypto.PublicKey import RSA
from Crypto import Random
gkey = RSA.generate(384, Random.new().read)
string = str((gkey.publickey().__getstate__(),
(333,444)))
print string
print
data = gkey.encrypt(string,"")
print "data:",data
print
print "decrypt"
print "decrypt,", gkey.decrypt(data)
print "done"
All I get are junk values when printing the decrypted value.
You are encrypting with RSA a piece of data which is way
larger than the key size (48 bytes).