Giter VIP home page Giter VIP logo

curvekey's Introduction

curvekey

Perform elliptic-curve Diffie-Hellmann key exchange over Curve25519 on the commandline.

install

go get -u github.com/ansemjo/curvekey

synopsis

Generate a new key:

$ curvekey new -k my.sec -p my.pub

Obtain a peer's public key and obtain a shared secret:

$ curvekey dh -p peer.pub -k my.sec
shared secret:
  edSr8Lko65qj4wk62S8/31iex4FFGDJyD5AAB9pjnq4=

Your partner can obtain the same secret with his secret key:

$ curvekey dh -p my.pub -k peer.sec
shared secret:
  edSr8Lko65qj4wk62S8/31iex4FFGDJyD5AAB9pjnq4=

For an ephemeral key omit the secret key:

$ curvekey dh -p peer.pub
shared secret:
  MblUjj06Rh8Q/V0HoPl6nrFavXmCEuHChG5HM0hdnJ4=
ephemeral public key:
  Emqq9yeFdhhspTW6aldqWWXSOpLxHDL4kVZUqMlKYAE=

Transmit the ephemeral public key to your peer:

$ curvekey dh -k peer.sec -p Emqq9yeFdhhspTW6aldqWWXSOpLxHDL4kVZUqMlKYAE=
shared secret:
  MblUjj06Rh8Q/V0HoPl6nrFavXmCEuHChG5HM0hdnJ4=

Consult the command help at any time:

$ curvekey --help
$ curvekey help shared
...

examples

Other usage examples and scenarios can be found in examples:

warning

This is unauthenticated Diffie-Hellmann. You should

  • transmit your public keys over secure channels
  • post them at a public place controlled by you
  • verify their integrity over a second channel
  • sign them by other means, e.g. GnuPG

Otherwise you may be susceptible to a man-in-the-middle attack.

And anyway: this was mainly intended as a thought experiment and another fun commandline tool to go with ansemjo/stdkdf and ansemjo/aenker. Do not rely on this.

license

Copyright (c) 2018 Anton Semjonov Licensed under the MIT License

curvekey's People

Contributors

ansemjo avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.