'Encrypt the message contained in the string \'data\'
>>> import shutil
>>> if os.path.exists("keys"):
...     shutil.rmtree("keys")
>>> gpg = GPG(gnupghome="keys")
>>> input = gpg.gen_key_input(passphrase=\'foo\')
>>> result = gpg.gen_key(input)
>>> print1 = result.fingerprint
>>> input = gpg.gen_key_input()
>>> result = gpg.gen_key(input)
>>> print2 = result.fingerprint
>>> result = gpg.encrypt("hello",print2)
>>> message = str(result)
>>> assert message != \'hello\'
>>> result = gpg.decrypt(message)
>>> assert result
>>> str(result)
\'hello\'
>>> result = gpg.encrypt("hello again",print1)
>>> message = str(result)
>>> result = gpg.decrypt(message)
>>> result.status == \'need passphrase\'
True
>>> result = gpg.decrypt(message,passphrase=\'bar\')
>>> result.status in (\'decryption failed\', \'bad passphrase\')
True
>>> assert not result
>>> result = gpg.decrypt(message,passphrase=\'foo\')
>>> result.status == \'decryption ok\'
True
>>> str(result)
\'hello again\'
>>> result = gpg.encrypt("signed hello",print2,sign=print1)
>>> result.status == \'need passphrase\'
True
>>> result = gpg.encrypt("signed hello",print2,sign=print1,passphrase=\'foo\')
>>> result.status == \'encryption ok\'
True
>>> message = str(result)
>>> result = gpg.decrypt(message)
>>> result.status == \'decryption ok\'
True
>>> assert result.fingerprint == print1'

def encrypt(self, data, recipients, **kwargs):

    data = _make_binary_stream(data, self.encoding)
    result = self.encrypt_file(data, recipients, **kwargs)
    data.close()
    return result
