Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: ecc_encrypt $message clear text is limited in length

by hippo (Abbot)
on Feb 09, 2018 at 09:36 UTC ( #1208793=note: print w/replies, xml ) Need Help??

in reply to ecc_encrypt $message clear text is limited in length

I've not yet attempted to diagnose what you've done fully but I believe I can answer one question you posed:

my $ct = $pk->ecc_encrypt($message,'SHA256'); #Why do I have to specifify a hash function?

The documentation for ecc_encrypt says "ECCDH Encryption is performed by producing a random key, hashing it, and XOR'ing the digest against the plaintext", so that is where the hash algorithm comes in. Note that the documentation also says that ecc_encrypt() is a function as opposed to a method but a perusal of the source suggests that it can be called either way. HTH.

Replies are listed 'Best First'.
Re^2: ecc_encrypt $message clear text is limited in length
by JalapenoBob (Initiate) on Feb 09, 2018 at 22:17 UTC
    @hippo, thanks... that clears things up a lot. I had not seen that in the documentation and it makes perfect sense now.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1208793]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-05-27 14:51 GMT
Find Nodes?
    Voting Booth?