def encrypt_bigfile(infile, outfile, pub_key):
 if (not isinstance(pub_key, key.PublicKey)):
  raise TypeError(('Public key required, but got %r' % pub_key))
 key_bytes = (common.bit_size(pub_key.n) // 8)
 blocksize = (key_bytes - 11)
 outfile.write(byte(varblock.VARBLOCK_VERSION))
 for block in varblock.yield_fixedblocks(infile, blocksize):
  crypto = pkcs1.encrypt(block, pub_key)
  varblock.write_varint(outfile, len(crypto))
  outfile.write(crypto)

def encrypt_bigfile ( infile , outfile , pub_key ) : if ( not isinstance ( pub_key , key . PublicKey ) ) : raise TypeError ( ( 'Public key required, but got %r' % pub_key ) ) key_bytes = ( common . bit_size ( pub_key . n ) // 8 ) blocksize = ( key_bytes - 11 ) outfile . write ( byte ( varblock . VARBLOCK_VERSION ) ) for block in varblock . yield_fixedblocks ( infile , blocksize ) : crypto = pkcs1 . encrypt ( block , pub_key ) varblock . write_varint ( outfile , len ( crypto ) ) outfile . write ( crypto )
encrypts a file .