Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Any way to improve performance? #465

@alexandervlpl

Description

@alexandervlpl

This library is excellent, but some quick benchmarking with a small message on my machine shows decryption taking ~200ms, encryption ~100ms (using Uncompressed). Is this to be expected with PGP, which was created for email back in the day? Or is it the Python implementation? Can anything be done to optimize, maybe on my side?

Using 2048 bit RSA keys created like this:

key = pgpy.PGPKey.new(PubKeyAlgorithm.RSAEncryptOrSign, 2048)
key.add_uid(uid, usage={KeyFlags.Sign, KeyFlags.EncryptCommunications, KeyFlags.EncryptStorage},
                    hashes=[HashAlgorithm.SHA256, HashAlgorithm.SHA384, HashAlgorithm.SHA512, HashAlgorithm.SHA224],
                    ciphers=[SymmetricKeyAlgorithm.AES256, SymmetricKeyAlgorithm.AES192, SymmetricKeyAlgorithm.AES128],
                    compression=[CompressionAlgorithm.ZLIB, CompressionAlgorithm.BZ2, CompressionAlgorithm.ZIP, CompressionAlgorithm.Uncompressed])

Edit: by comparison, the GnuPG wrapper around gpg encrypts and decrypts 10x faster with the same key and message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions