def encrypt(self, recipient=None): import duckbill.config if recipient is None: recipient = duckbill.config.GNUPG_RECIPIENT gpg = GnuPG() data = "|".join([self.owner, self.number, self.expire.toSQL()]) self._cipher = gpg.encrypt_string(data, [recipient]) return self._cipher