def _encrypt(self, message, recipient): encrypted_data = util.gpg_encrypt(self.gpg, sender=self.fp, message=message, recipient=recipient, passphrase=self.passphrase) return encrypted_data
def authenticate_person(recipient_id): key = util.gpg_decrypt(app.gpg, request.data, config.SERVER_PASSPHRASE) key2 = util.generate_random_string(32) body = {'key': str(key), 'key2': key2} msg = json.dumps(body) server_fp = util.get_fp_from_gpg(app.gpg, config.SERVER_KEY_FP) encrypted = util.gpg_encrypt(app.gpg, server_fp, msg, recipient_id, config.SERVER_PASSPHRASE) return str(encrypted), 200
def _encrypt(self, message, recipient): encrypted_data = util.gpg_encrypt( self.gpg, sender=self.fp, message=message, recipient=recipient, passphrase=self.passphrase ) return encrypted_data