Project

dhkeyx

0.0
No commit activity in last 3 years
No release in over 3 years
An implementation of the Diffie Hellman key exchange protocol
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.4
>= 0.9.5, ~> 0.9
 Project Readme

DHKeyX

An implementation of the Diffie–Hellman key exchange for Ruby.

This is a fork of: https://rubygems.org/gems/dhkeyexchange for Ruby >= 1.9.2.

INSTALLATION

$[sudo] gem install dhkeyx

OSX 10.7 and higher will get deprecation warnings due to Apples attempt to move away from OpenSSL

USAGE

  require 'dhkeyx'

  #DHKey.new([base], [prime], [private_key])

  bob   = DHKey.new

  alice = DHKey.new(bob.base, bob.prime)

  bob.their_public_key = alice.x
  alice.y              = bob.my_public_key

  bob.shared_key  == alice.k
  => true

  bob.private_key == alice.a
  => false

METHODS => ALIAS

'base=' => 'g='

'prime=' => 'p='

'private_key=' => 'a='

'their_public_key=' => 'y='


'base' => 'g'

'prime' => 'p'

'private_key' => 'a'

'my_public_key' => 'x'

'their_public_key' => 'y'

'shared_key' => 'k'