我正在尝试使用 PGP 实现加密,并且我的加密方法成功地加密了输入字符串,但是当我尝试对其进行解密以验证加密是否正确完成时,该字符串没有被解密。
我尝试了两种方法:
1st approach uses FileOutputStream to write encrypted string & 2nd approach uses ByteArrayOutputStream. FileOutputStream creates a file and I am able to decrypt it using Kleopatra. However my requirement is to just get an encrypted string (not written in a file). So when I try to decrypt the encrypted string (received after using ByteArrayOutputStream) its not working. I tried copying the string and decrypting it through tools>>clipboard in Kleopatra, but the decrypt/verify option is …