Remove eth-ecies lib#27
Conversation
| */ | ||
| const encrypt = (pubKeyTo, plaintext, opts) => | ||
| ecies.encrypt(toBuffer(pubKeyTo), toBuffer(plaintext), opts); | ||
| const encrypt = async (pubKeyTo, plaintext) => { |
There was a problem hiding this comment.
is padding added to the plaintext? What if you encrypt a single byte?
There was a problem hiding this comment.
It's randomized in many places. If you encrypt the same text with the same key you will get a totally different encrypted output every time.
There was a problem hiding this comment.
I verified that it is happening
godfreyhobbs
left a comment
There was a problem hiding this comment.
Can you add test for failure cases.
pt is empty, too short
key is empty, too short, not hex
|
Also please consider what Dan mentioned in the following: TLDR I would love it if you could add this. @davidrhodus @MaxBlaushild what do you think? Would could include the |
MaxBlaushild
left a comment
There was a problem hiding this comment.
Agree with Godfrey on the extra test cases. Will approve on receipt
| const encrypt = (pubKeyTo, plaintext, opts) => | ||
| ecies.encrypt(toBuffer(pubKeyTo), toBuffer(plaintext), opts); | ||
| const encrypt = async (pubKeyTo, plaintext) => { | ||
| pubKeyTo = pubKeyTo.toString('hex') |
There was a problem hiding this comment.
new const for new value
| const decrypt = (privKey, encrypted) => | ||
| ecies.decrypt(toBuffer(privKey), toBuffer(encrypted)); | ||
| const decrypt = async (privKey, encrypted) => { | ||
| privKey = privKey.toString('hex') |
|
@godfreyhobbs i like that a lot! i think implementing the identifiers should be handled in a separate ticket to keep complexity to a minimum though |
No description provided.