Skip to content

paulpeng-popo/Attribute-Based-Encryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABE Installation Instructions

  • gmp

  • PBC

  • Charm

  • ABE-python

  • My configurations:

    • ubuntu 20.04
    • openssl (1.1.1f-1ubuntu2.4)
    • python 3.7.11 (sets virtual env)
    • gmp-6.2.1
    • pbc-0.5.14
    • charm-v0.50
  • Result:

    • SUCCESS :)
    • Time stamp: 2021/8/3 10:38:50
  • Note: If you are lazy, I have provided download saves in my repository

  • Note: I considered that python versions which is 3.8+ may encounter error during make

  • Note: Many of instructions were compiled from below two references

  • References: Link1 (English) and Link2 (Simplified Chinese)

Prerequisites (gmp, pbc, charm)

  1. Before installing, you will need (if you have already installed one of them before, just skip it)

    • sudo apt-get install m4
    • sudo apt-get install -y flex
    • sudo apt-get install bison
    • sudo apt-get install -y openssl
    • sudo apt-get install -y libssl-dev
  2. First, we started from gmp (gmp-6.2.1.tar.zst for example)

    • Enter super user mode (optional)
      sudo su    # or you add 'sudo' in front of every command below
    • Expand .tar.zst
      apt get install zstd    # skip if you have already installed before
      tar -I zstd -xvf gmp-6.2.1.tar.zst
    • Configure and install and check
      cd gmp-6.2.1
      ./configure
      make
      make install
      make check
    • Some dependencies should be installed finally
      apt-get install -y libgmp10 libgmp-dev
    • gmp installation complete
  3. Second, we then downloaded PBC library source code (pbc-0.5.14.tar.gz for example)

    • Expand .tar
      tar -xvf pbc-0.5.14.tar.gz
    • Configure and install and check
      cd pbc-0.5.14
      ./configure
      make
      make install
      make check    # optional
    • PBC installation complete
  4. Some dependencies required before getting into Charm

    • Add python PPA sources and download python 3.7 and dev
      sudo add-apt-repository ppa:deadsnakes/ppa
      sudo apt update
      sudo apt install python3.7 python3.7-dev
    • Set-up a python 3.7 environment (py37 for example, you can rename py37 as you want)
      sudo apt install virtualenv
      virtualenv -p /usr/bin/python3.7 py37
      source py37/bin/activate
    • Now your PS will look like this
      (py37) user@Ubuntu-20.04:~ $
    • Step 5 should be operated under this python environment (py37)
  5. Last, access charm github project v0.50 (Version 0.50 is required if your openssl version is 1.1 or above)
    Some improvements detailed in official documentation

    • v0.50 is not released currently, so we just git clone it from this repository
      git clone https://github.com/JHUISI/charm.git
    • Install all the other dependencies and configure and install and test
      cd charm
      pip install -r requirements.txt
      ./configure.sh
      cd ./deps/pbc && make && sudo ldconfig && cd -    # this command seems downloading pbc-0.5.14.tar.gz again, maybe we can skip it, but I'm not sure with that
      make
      make install && sudo ldconfig    # is lowercase letter 'L', neither number 1 nor uppercase letter 'i'
      make test    # test your charm installation
    • After tests, it will show message look like
      ===================================== 185 passed, 3 skipped, 6 warnings in 18.36s ======================================
    • Congratulation :)
    • Charm installation complete

Attribute-Based Encryption python3 (ABE)

  • See official documentation
  • NOTE: we won't execute following command
    pip install -r requirements.txt    # this will install charm-crypto in old version 0.43
  • First, we git clone from this repository
    git clone https://github.com/sagrawal87/ABE.git
  • Compile and install
    make && pip install .
  • Test ABE using samples/main.py
    python samples/main.py
  • You can easily modify samples/main.py to try any scheme you wish.
  • ABE installation complete

Congratulation! Welcome to the world of cryptography

About

Help me install ABE from sagrawal87/ABE step-by step

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published