I’m using the RSA implementation in PyCrypto. With regard to the encrypt(self, plaintext, K) method K is a parameter of random data. I want to know how much random data needs to be passed in order for the encryted data to be considered secure. For example in my implementation I am passing a strong prime number of 1024 bits via the Crypto.Util.number module like so:
enc_data = public_key.encrypt(data, number.getPrime(1024))
Is this considered ‘secure enough’?
Thanks
The RSA implementation does not use the K parameter. You may ignore it; the RSA implemention does.
Looking at lines 59-60 of
pycrypto-2.3/lib/Crypto/PublicKey/RSA.pyyou see the following:Which proves that
K, if supplied, is ignored.Official documentation
Plus, the developers declare this explicitly in the documentation. In fact, if you create a public key
public_keyand you typeyou will obtain their documentation, which explicitly says: