Encrypt data with ECIES method using the public key of the recipient.
(data, pubkey, ephemcurve=None, ciphername='aes-256-cbc')
| 438 | |
| 439 | @staticmethod |
| 440 | def encrypt(data, pubkey, ephemcurve=None, ciphername='aes-256-cbc'): |
| 441 | """ |
| 442 | Encrypt data with ECIES method using the public key of the recipient. |
| 443 | """ |
| 444 | curve, pubkey_x, pubkey_y, i = ECC._decode_pubkey(pubkey) |
| 445 | return ECC.raw_encrypt(data, pubkey_x, pubkey_y, curve=curve, |
| 446 | ephemcurve=ephemcurve, ciphername=ciphername) |
| 447 | |
| 448 | @staticmethod |
| 449 | def raw_encrypt(data, pubkey_x, pubkey_y, curve='sect283r1', |
no test coverage detected