def encrypt_int(message, ekey, n):
 if (type(message) is types.IntType):
  message = long(message)
 if (not (type(message) is types.LongType)):
  raise TypeError('You must pass a long or int')
 if ((message < 0) or (message > n)):
  raise OverflowError('The message is too long')
 safebit = (bit_size(n) - 2)
 message += (1 << safebit)
 return pow(message, ekey, n)

def encrypt_int ( message , ekey , n ) : if ( type ( message ) is types . IntType ) : message = long ( message ) if ( not ( type ( message ) is types . LongType ) ) : raise TypeError ( 'You must pass a long or int' ) if ( ( message < 0 ) or ( message > n ) ) : raise OverflowError ( 'The message is too long' ) safebit = ( bit_size ( n ) - 2 ) message += ( 1 << safebit ) return pow ( message , ekey , n )
encrypts a message using encryption key ekey .