ec_dh {openssl} | R Documentation |
Key agreement is one-step method of creating a shared secret between two peers. Both peers can indendently derive the joined secret by combining his or her private key with the public key from the peer.
ec_dh(key = my_key(), peerkey, password = askpass)
key |
your own private key |
peerkey |
the public key from your peer |
password |
passed to read_key for reading protected private keys |
Currently only Elliptic Curve Diffie Hellman (ECDH) is implemented.
https://wiki.openssl.org/index.php/EVP_Key_Agreement, https://wiki.openssl.org/index.php/Elliptic_Curve_Diffie_Hellman
## Not run: # Need two EC keypairs from the same curve sk1 <- ec_keygen() pk1 <- as.list(sk1)$pubkey sk2 <- ec_keygen() pk2 <- as.list(sk2)$pubkey # Both peers can derive the shared secret alice <- ec_dh(sk1, pk2) bob <- ec_dh(sk2, pk1) ## End(Not run)