Giter Club home page Giter Club logo

erlgamal's Introduction

Quick start

Pre-requisists: Install GNU's Multiple Precision Arithmetic Library (GMP)

$ git clone [email protected]:joagre/erlgamal.git
...
$ make
...
$ erl -pa lib/sstdlib/ebin -pa lib/elgamal/ebin -pa lib/elgamal/test
Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Eshell V10.7  (abort with ^G)
1> unit_test_elgamal:start().
Randomized ciphertext size: 1325
Randomized ciphertext size: 1837
Randomized ciphertext size: 2348
Randomized ciphertext size: 2859
Randomized ciphertext size: 3370
Randomized ciphertext size: 3881
Randomized ciphertext size: 4392
Randomized ciphertext size: 4904
Randomized ciphertext size: 5416
Randomized ciphertext size: 5928
ok
2> 

Files

./lib/elgamal/src/elgamal.erl
./lib/elgamal/src/elgamal.hrl

The multiplicative and additive ElGamal encryption library. More info is availble in elgamal.erl and elgamal.hrl.

./lib/elgamal/test/unit_test_elgamal.erl

Test suite which tests the elgamal module. More info is availble in unit_test_suite.erl.

./lib/sstdlib/src/mpz.erl
./lib/sstdlib/src/gmp_nif.erl
./lib/sstdlib/c_src/gmp_nif.c
./lib/sstdlib/c_src/dloglib.c

The mpz module makes a number of functions available from GMP:

  • generate_safe_prime
  • mpz_gcd
  • mpz_invert
  • mpz_lcm
  • mpz_powm
  • mpz_pow_ui
  • mpz_probab_prime_p

Additionally a dlog function is made available to perform fast calculation of the discrete logarithm using Pollard’s rho-method as described in https://www.luke.maurits.id.au/files/misc/honours_thesis.pdf

Note: To debug the dlog stuff use the standalone lib/sstdlib/c_src/dlog.c

erlgamal's People

Contributors

joagre avatar

Stargazers

Ricardo Lanziano avatar Leonardo Rossi avatar

Watchers

Tony Rogvall 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.