我正在使用python flask开发区块链系统。我使用RSA密钥(大小= 2048)作为钱包。我使用base64来减少私钥的大小,但它仍然太长
rsaObj = RSA.generate(2048)
privateKey = rsaObj.exportKey()
print privateKey
# output
"""
-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEA3qP80JKhGgn9IQ4P0khE5Y67bA0rPCgEp2pE1i7I5V32X9rH
ttO8O3qgchdtUojhaDtMk3ixj8ihNGtRPcYlJ34rEn0eafddSZVnteb9RMrtKOyx
d+1pWPORyQY+DqJ9byySDCjXlgUODQkiYtrdbUI9CQU/U3DxcFNnbSmVRfAI4gN/
Pgb//QMLjlSQhtiSWERrQHGhcjoUXuhF2sYTK/JQ5HUL6sj82XRBVLJVqe6pUYZD
JMlJg2rqW9agw/nWlOnL7gmRpJQmZOJ4u7l8mAByknDquDU6yop2l7wQOpfspp5B
CDKsbhoZUxpFMkuoHCyKAlRKuk6854JW6ORdGwIDAQABAoIBAQCDVbFZSGYIekP8
L9NddIxP7nbZMpuCjQjRyXp57ndL9rXTrbeKPjUX0Sq8ot02htCRMAnoJJZ5/xw5
U+VEz5IzTdYSvgQm9mjtc1kOkQhugFaOgbHe0QoIEwa40xnggDIGVwCAc8dZE/pJ
7k1+iyV7wktG+vV0P3ftjwW/+3u3GNwOmwikQ1KXQ2UobWXDPSULpPo053uSh2i4
D4GFs4PS4f7qQQT3/BuEJpp/EdVAQjyJwG6BnDbwOpYu8hd3bqe1ST38v0jzlqjM
rDhvbrvpwr4Ugbs4TCpWCibb4lOoy0yLU8Ixt7bQQgDGJLdIC7s/01qC+jdOLiPB
vGOJz+zBAoGBAOaVanrADhvFYsabWYVeYh8qwNBoLuyFFsepFwzCCvuCoycIyopm
EwblyikGyH0K9UKBU7abnCKEld1s3hHdVkeNfb/eMjaoEqEHdUxWkw+oLNoZJxri
+4PFlNUs1YDKIWCOTzcm3JKHX6Td4CS66BSqtGo7sA3YxAMlnwAWGFDZAoGBAPcu
b0dMOrGOcDfx7kMfHrINsH0WSF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