LoginSignup
1
1

More than 3 years have passed since last update.

CP-ABEのインストール

Last updated at Posted at 2021-05-31

概要

CP-ABE(Ciphertext-Policy Attribute-Based Encryption)のインストールに手こずったので備忘録としてまとめます.間違っていたら申し訳ありません.各ライブラリやソフトフェアの説明は省略させていただきます.
CP-ABE

環境

Ubuntu 20.04.2 

手順

CP-ABEをインストールするにはいくつかの依存関係のあるライブラリやソフトウェアが必要となります.そのためまずはそちらのインストールを行います.
具体的にはCP-ABEにはPBCライブラリが必要に,PBCライブラリはGMPライブラリの上に構築されているためGMPライブラリのインストールが必要になります.また,GMPライブラリのインストールにはM4,bison,flexが必要となります.

M4,bison,flexのインストール

sudo apt install m4
sudo apt install flex
sudo apt install bison

GMPライブラリのインストール

GMP

wget https://gmplib.org/download/gmp/gmp-6.2.1.tar.lz
tar --lzip -xvf gmp-6.2.1.tar.lz
cd gmp-6.2.1.tar.lz
./configure
make check
sudo make
sudo make install

PBCライブラリのインストール

PBC Library

wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz
tar zxvf pbc-0.5.14.tar.gz
./configure
sudo make
sudo make install

CP-ABEのインストール

CP-ABEをインストールする前にoppensslとglibがインストールされていなければインストールします.

sudo apt install libssl-dev
sudo apt install libglib2.0-dev

インストールが完了したらCP-ABEのインストール作業に入ります.
CP-ABE
パッケージがcpabeとlibbswabeの2種類ありますが,libbswabeを先にインストールします.

wget http://acsc.cs.utexas.edu/cpabe
tar -xvf libbswabe-0.9.tar.gz
cd libbswabe-0.9
./configure
sudo make
sudo make install

インストールが完了したらcpabeのインストールを行います.

wget http://acsc.cs.utexas.edu/cpabe/cpabe-0.11.tar.gz
tar -xvf cpabe-0.11.tar.gz
cd cpabe-0.11
./configure

生成されたMakefileでmakeしようとするとエラーを吐くため以下のようにファイルを書き換える.

Makefile
LDFLAGS = -O3 -Wall \
        -lglib-2.0 \
        -Wl,-rpath /usr/local/lib -lgmp \
        -Wl,-rpath /usr/local/lib -lpbc \
        -lbswabe \
        -lcrypto -lcrypto \
        -lgmp
policy_lang.y
result: policy { final_policy = $1; }

ファイルを書き換えるとmakeが通る.

sudo make
sudo make install

ここまでできればCP-ABEが動くはずなのでチュートリアルに沿って進めてみてください.
http://acsc.cs.utexas.edu/cpabe/tutorial.html

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1