Coder Social home page Coder Social logo

lubux / afgh-pre-relic Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 73 KB

AFGH Proxy Re-Encryption with RELIC (C library)

License: MIT License

CMake 1.01% C++ 21.49% C 69.45% Shell 0.26% Python 6.83% Makefile 0.96%
cryptography proxy-re-encryption c

afgh-pre-relic's Introduction

AFGH Proxy Re-Encryption with RELIC

Build status

Implements the AFGH proxy re-encryption scheme as presented in:

  • link Ateniese et al. Improved Proxy Reencryption Schemes with Applications to Secure Distributed Storage. In NDSS, 2006.

This code is ported from the additive homomorphic PRE in Pilatus Code. The implementation uses the relic toolkit as a backend for the underlying pairing-based crypto.

Install Relic

The default settings to install relic.

./preset/gmp-pbc-bls381.sh
make 
sudo make install

or

./scripts/install-relic-ubuntu.sh

Compile

Cmake is required to compile the code.

make

The main.cpp file contains the basic test code and shows how to use the library.

./bin/relic-pre

The benchmark_pre.cpp file contains the simple benchmark code.

./bin/relic_pre_re_enc_benchmark

Performance Indicator

Benchmark results on on a MacBook Pro 2017 2.8 GHz Intel Core i7

-- Curve B12-P381:
Performing 100 runs

Public Parameter Generation
	avg: 2120us
	min: 2104us
	max: 2203us

Public Parameter Encoding
	avg: 3us
	min: 3us
	max: 6us

Public Parameter Decoding
	avg: 7us
	min: 7us
	max: 17us

Secret Key Generation
	avg: 53us
	min: 45us
	max: 70us

Secret Key Encoding
	avg: 0us
	min: 0us
	max: 0us

Secret Key Decoding
	avg: 0us
	min: 0us
	max: 0us

Public Key Generation
	avg: 537us
	min: 513us
	max: 578us

Public Key Encoding
	avg: 1us
	min: 1us
	max: 1us

Public Key Decoding
	avg: 2us
	min: 2us
	max: 4us

Keypair Derivation
	avg: 594us
	min: 564us
	max: 628us

Encryption
	avg: 1368us
	min: 1265us
	max: 1524us

Decryption
	avg: 2785us
	min: 2699us
	max: 2887us

Token Generation
	avg: 648us
	min: 570us
	max: 717us

Token Encoding
	avg: 1us
	min: 1us
	max: 1us

Token Decoding
	avg: 2us
	min: 2us
	max: 3us

Re-Encryption
	avg: 2120us
	min: 2104us
	max: 2210us

Decryption (re-encrypted)
	avg: 1096us
	min: 978us
	max: 1209us

Experimental Code

This is experimental code and provides NO security guarantees.

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.