Open theahura opened 2 years ago
Update: it seems like this is an issue with the cleartext parameter. In particular, the following code (taken from the examples) works:
message = PGPMessage.new("42 is quite a pleasant number")
enc_message = message.encrypt("S00per_Sekr3t")
dec_message = enc_message.decrypt("S00per_Sekr3t")
print(dec_message.message)
and this does not:
message = PGPMessage.new("42 is quite a pleasant number", cleartext=True)
enc_message = message.encrypt("S00per_Sekr3t")
dec_message = enc_message.decrypt("S00per_Sekr3t")
print(dec_message.message)
I'm running into trouble encrypting and decrypting strings with the passphrase functionality using PGPy.
The above code correctly returns a PGP string, like:
I then want to unencrypt this message. I tried the following:
This results in a not implemented error:
Doing a bit of poking around, it looks like the
_message
field of the decrypted message is empty (None
). What am I doing wrong?Context: I want to send messages over the wire to and from a server from a web client using openpgp.js, so I need to convert the PGPy classes into strings or bytes somewhere at the interface.