Skip to content

This repository provides implementation examples for various Attribute-Based Encryption Libraries.

Notifications You must be signed in to change notification settings

PekeDevil/ABE_Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Index


What is this about?

This repository provides implementation examples for various Attribute-Based Encryption Libraries. The libraries this repo provides code for are:

  • Charm: A python🐍 library. The most complete one.
  • Rabe: A Rust🦀 library. Always use v0.3.1 upwards, since earlier versions use AES instead of AES-GCM.
  • GoFE: A Go library, the only one for Go when this repo was created. It has a sister library written in C, Cifer.
  • OpenABE: A C++ library. The most efficient one.

The repository has been created with the code used for the article "Too many options: A survey of ABE libraries for developers".

Therefore, it offers code for the timing measurement of different schemes provided by the libraries Charm, Rabe, Gofe and OpenABE. In all cases, both the code used to perform the timing measurements and a simplified code that serves as a basic example are provided.

Examples and Time Tests

Charm

We provide implementation examples for the following schemes:

In addition, a common way to use ABE encryption is in a hybrid form with a symmetric encryption. For this purpose, Charm provides an abstraction layer that allows the hybrid cipher to be called directly. The example shows how it can be used.

Rabe

GoFE

OpenABE

A note on installation:

These experiments were conducted on a Raspberry PI Zero and a Raspberry PI 4 between 2022 and 2023. Thus, it is recommended that all the information in this repository be used as a guideline and that things may have changed over time.

Due to the architectures of these boards, it was sometimes necessary to make certain modifications to perform the installations correctly.

The main limitation of the Raspberry Pi Zero was its ARMv6 architecture, which is incompatible with certain libraries. In the case of the Raspberry PI 4, it was necessary to manage its compatibility with ‘old’ versions of certain distros.

Some of the modifications, tricks, and shortcuts used to install the libraries this repository provides examples of are described below.

Charm Installation

Recommended Python Version

For best compatibility, it is recommended to use Python versions 3.8 to 3.10. Python 3.12 introduces changes to the longintrepr.h header file location, which may cause issues with the Charm library. For more details, refer to this issue discussion..

About Dependencies

While setting up the environment, you may need to install the following dependencies:

  • libssl-dev
  • flex
  • bison

When configuring the mathematical library, Charm offers the possibility to use both PBC and Relic. However, I was unable to perform a successful installation with Relic and ended up using PBC.

Virtual Environment

Finally, after several problems with dependencies and installations, I ended up working with Python virtual environments.

It is quite possible that you don't need to do this and that some of my problems came from incompatibilities derived from some versions of dependencies installed on the Raspberries.

However, if you are still having problems, this tutorial was the one I followed to successfully install Charm.

OpenABE Installation

The original OpenABE library does not support compilation on ARM architectures. Therefore, IBM modified the makefile used by OpenABE to compile relic. In this way, IBM was able to make it ARM-compatible.

The main modifications are related to the parameters with which relic is compiled. However, these modifications were insufficient to run OpenABE on ARMv6.

Therefore the makefile was modified again following the help of the relic repository. The final result was used to compile OpenABE on both ARMv6 and ARMv8.

Finally another common problem in the OpenABE installation is that it uses the GoogleTest, and the location of the files in this repository often varies. Therefore it may be necessary to modify the download_gtest.sh file and adjust the GTEST_LINK.


Credit where credit is due

This repo only provides implemenation examples. They are not supposed to be infalible, just a starting point for developers, since when I had to work with them sometimes documentation was a bit dense. Well, that or it required more knowhow than the one I had. Therefore, altough this repo may be useful, the ones that actually made it possible are the original libraries developers.

If, despite everything, you still want to help me, you can check out the paper I wrote analysing these libraries to the best of my knowledge: ArXiv

@article{mosteiro2022too,
    title={Too Many Options: A Survey of ABE Libraries for Developers},
    author={Mosteiro-Sanchez, Aintzane and Barcelo, Marc and Astorga, Jasone and Urbieta, Aitor},
    journal={arXiv preprint arXiv:2209.12742},
    url: {https://arxiv.org/abs/2209.12742},
    year={2022}
}

About

This repository provides implementation examples for various Attribute-Based Encryption Libraries.

Resources

Stars

Watchers

Forks

Packages

No packages published