polkascan / py-substrate-interface

Python Substrate Interface
https://polkascan.github.io/py-substrate-interface/
Apache License 2.0
240 stars 114 forks source link

Message encryption and decryption methods #213

Closed khssnv closed 2 years ago

khssnv commented 2 years ago

The update contains message encryption and decryption methods for Keypair class. It is compatible with JavaScript implementation. Both implementations produce the same encrypted output for the same keys provided and both can decrypt a message produced by each other. Unlike JavaScript implementation, this one supports ed25519 keys only. Sr25519 support may be implemented in future versions.

PyNaCl package added to dependencies for encryption and decryption functionality as the most well-supported alternative to tweetnacl used in JavaScript implementation.

arjanz commented 2 years ago

Thanks for the PR, this is a nice addition to the library..

I checked it out and looks good, the only thing that is missing is the addition of the PyNaCl dependency in setup.py so that it will be included when installing using PyPI..

If you could add that then I'll be happy to merge!

khssnv commented 2 years ago

Thank you. Dependency added to setup.py. Hope we are good now! Please let me know if you want me to change anything else before merge.