{"library":"pgpy13","title":"PGPy","description":"PGPy is a Python library for Pretty Good Privacy (PGP) encryption and signing. This temporary fork (pgpy13) provides Python 3.13 compatibility for the original PGPy library. Current version 0.6.1rc1 targets Python >=3.9.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pgpy13"],"cli":null},"imports":["from pgpy import PGPKey","from pgpy import PGPMessage"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pgpy\nfrom pgpy.constants import (\n    PubKeyAlgorithm,\n    KeyFlags,\n    HashAlgorithm,\n    SymmetricKeyAlgorithm,\n    CompressionAlgorithm\n)\n\n# Generate a new RSA key\nkey = pgpy.PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, 2048)\nuid = pgpy.PGPUID.new('Alice', email='alice@example.com')\nkey.add_uid(uid, usage={KeyFlags.EncryptCommunications, KeyFlags.SignData},\n            hashes=[HashAlgorithm.SHA256],\n            ciphers=[SymmetricKeyAlgorithm.AES256],\n            compression=[CompressionAlgorithm.ZLIB])\n\n# Save private key\nwith open('private.key', 'wb') as f:\n    f.write(str(key).encode())\n\n# Encrypt a message\nmsg = pgpy.PGPMessage.new('Hello, world!')\nencrypted = key.encrypt(msg)\nprint(encrypted)","lang":"python","description":"Generate a PGP key, save to file, encrypt a message.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}