[pycrypto] Crypto.PublicKey.RSA and number.py

Anthony Honstain honstain at gmail.com
Wed Mar 11 23:47:03 CST 2009

I am working towards using the Crypto.PublicKey.RSA encryption and
eventually padding like PKCS#1. I have observed that the leading
'\000' are removed. Is this the desired behavior of bytes_to_long and
long_to_bytes? Or is this not an issue once a good padding scheme is

For example: from lib/Crypto/Util/number.py module, using
bytes_to_long and long_to_bytes.
>>> teststring
>>> result = bytes_to_long(teststring)
>>> result
>>> long_to_bytes(result)

Anthony Honstain

More information about the pycrypto mailing list