pybitmessage.highlevelcrypto module

High level cryptographic functions based on pyelliptic OpenSSL bindings.


Upstream pyelliptic was upgraded from SHA1 to SHA256 for signing. We must upgrade PyBitmessage gracefully. More discussion.

makeCryptor(privkey, curve='secp256k1')[source]

Return a private pyelliptic.ECC instance


Converts hex private key into hex public key

encrypt(msg, hexPubkey)[source]

Encrypts message with hex public key

sign(msg, hexPrivkey)[source]

Signs with hex private key using SHA1 or SHA256 depending on “digestalg” setting

verify(msg, sig, hexPubkey)[source]

Verifies with hex public key using SHA1 or SHA256


Does an EC point multiplication; turns a private key into a public key.

Evidently, this type of error can occur very rarely:

>>> File "", line 54, in pointMult
>>>  group = OpenSSL.EC_KEY_get0_group(k)
>>> WindowsError: exception: access violation reading 0x0000000000000008