GithubHelp home page GithubHelp logo

zeutro / openabe Goto Github PK

View Code? Open in Web Editor NEW
253.0 18.0 69.0 1.37 MB

The OpenABE library - open source cryptographic library with attribute-based encryption implementations in C/C++

Home Page: http://www.zeutro.com

License: GNU Affero General Public License v3.0

Makefile 0.89% C++ 90.06% Shell 2.47% C 3.83% Yacc 0.70% LLVM 0.51% Python 0.42% Cython 1.12%
attribute-based-encryption cryptography pairing-based

openabe's Introduction

OpenABE

OpenABE is a cryptographic library that incorporates a variety of attribute-based encryption (ABE) algorithms, industry standard cryptographic functions and tools, and an intuitive application programming interface (API). OpenABE is intended to allow developers to seamlessly incorporate ABE technology into applications that would benefit from ABE to protect and control access to sensitive data. OpenABE is designed to be easy to use and does not require developers to be encryption experts.

This bundle includes full source code, examples and three main sources of documentation:

  1. OpenABE API Guide Document - explains how to install and use the library.
  2. OpenABE CLI Util Document - shows how to use the included command-line tools, including benchmarking.
  3. OpenABE Design Document - explains in detail the functionalities and algorithms implemented.

The software is available for use under the AGPL 3.0 license.

What is Attribute-Based Encryption (ABE)?

Encryption is a method of encoding data that protects the confidentiality of its contents from unauthorized attackers. Traditionally, encryption was viewed as a tool to enable secure communication between a sender and a targeted recipient of information. For example, one might wish to store a message such that it can only be decrypted by the user [email protected].

Attribute-Based Encryption is a more expansive type of public key encryption that allows for flexible policy-based access controls that are cryptographically (that is, mathematically) enforced. Instead of encrypting data to a single user, it is now possible to encrypt it so that the data can be decrypted by anyone with credentials satisfying an arbitrary attribute-based access control policy.

In OpenABE, any string can potentially serve as an attribute. In addition, attributes can be numeric values and policies can contain ranges over these values. The set of attributes used will depend on the designated application.

In order to understand the capabilities of ABE, it helps to organize them logically into three variants.

  • Content-Based Access Control - for granting selective access later (e.g., cloud, email, big data, subpoenas).

    In an ABE system for content-based access control, attributes are associated with a ciphertext and the private key is associated with a policy over these attributes. (In academic literature, this variant is sometimes referred to as "Key-Policy" ABE.) For example, a company could automatically encrypt all of its emails with the attributes being some (or all) of the 75 fields in Mail headers and then later the company can distribute a key to an analyst that allows for decryption of all emails that meet the policy of To:[email protected] OR (subject contains cascade project AND sent between Dec 21, 2017 and Jan 10, 2018.

  • Role-based Access Control - for policies known at the time of encryption (e.g., classified documents, medical records).

    An ABE system for role-based access control "flips" the semantics of content-based access control. In such a system, attributes are associated with a private key and a policy (or boolean formula) is associated with the ciphertext. Here the attributes are often be associated with the credentials of a private key holder. (In academic literature this variant is sometimes referred to as "Ciphertext-Policy" ABE.) For instance, one could restrict a ciphertext only to female employees who have been with the company since 2012 and worked on the "HALE" software project.

  • Multi-authority Role-based Access Control - for operating across organizational boundaries.

    One issue with role-based access control is that in many applications you may need to write access control policies that span across different administrative boundaries. In standard ABE, there is one authority that hands out private keys. However, in some applications, it is natural for different authorities to manage different attributes. A multi-authority ABE system allows one to associate a ciphertext with a policy written across attributes issued by different authorities. These authorities can operate independently and do not have to coordinate (or even be aware of) each other.

    For instance, the government might certify the attributes in a person's driver's license (such as age), while a credit score company could distribute credentials about a user's credit score and an employer could distribute credentials about its employees. With this type of ABE, one can now send out a special offer readable by anyone over age 50 with a strong credit score and a job at a local employer.

What cryptographic algorithms are implemented in OpenABE?

OpenABE is a C/C++ software library offering several attribute-based encryption (ABE) schemes together with other core cryptographic functionalities such as authenticated symmetric-key encryption, public key encryption, digital signatures, X.509 certificate handling, key derivation functions, pseudorandom generators and more.

For the full cryptographic technical details inside OpenABE, see the included OpenABE Design Document.

Application developers should not need to be cryptographic experts to use ABE. To make OpenABE as secure and user-friendly as possible, the following features are provided by default:

  1. Collusion-Resistant: Common pitfall in ABE scheme development; Alice and Bob should not be able to combine their private keys to decrypt a ciphertext that neither can decrypt on their own. Note: any attempt to "engineer" ABE from standard public key encryption usually falls to this attack.
  2. Chosen Ciphertext Attack (CCA) Secure: Prevents serious and practical tampering attacks; most existing schemes in the academic literature only satisfy a weaker security notion (CPA-security).
  3. Unrestricted Attributes: Attributes can be represented by any string (alternative: must enumerate every current and future attribute at system initialization) and can be used an unlimited number of times in a policy.

OpenABE comes with support for efficient and optimized implementations of content-based and role-based ABE schemes.

For the full cryptographic technical details inside OpenABE, see the included OpenABE Design Document.

What platforms are supported in OpenABE?

Currently, OpenABE can be installed in the following environments:

  • Debian 7-9 and Ubuntu (12.04+)
  • CentOS 6/7 and Red Hat Linux 6/7
  • Mac OS X (10.8+)
  • Windows 7+ (via MINGW)
  • Android (NDK r10e)

Installation

This section describes the installation of the OpenABE source code (libopenabe-1.0.0-src.tar.gz) on various platforms. The OpenABE currently supports several operating systems including multiple versions/distros of Linux, Mac OS X and Windows.

Debian/Ubuntu-based Linux

To compile OpenABE on Ubuntu or Debian Linux-based distro, first run the deps/install_pkgs.sh script from the source directory to install the OpenABE system-specific dependencies as follows:

cd libopenabe-1.0.0/
sudo -E ./deps/install_pkgs.sh

Note that you only have to do this once per system setup. After completion, you can proceed to compile the OpenABE as follows:

. ./env
make
make test

All the unit tests should pass at this point and you can proceed to install the OpenABE in a standard location (/usr/local) as follows:

sudo -E make install

To change the installation path prefix, modify the INSTALL_PREFIX variable in libopenabe-1.0.0/Makefile.

CentOS and RedHat Linux

As before, first run the script from the source directory to setup OpenABE dependencies:

cd libopenabe-1.0.0/
sudo ./deps/install_pkgs.sh
scl enable devtoolset-3 bash

Note that you only have to do this once per system setup. After completion, you can proceed to compile the OpenABE as follows:

. ./env
make
make test

All the unit tests should pass at this point and you can proceed to install the OpenABE in a standard location (/usr/local) as follows:

sudo make install

To change the installation path prefix, modify the INSTALL_PREFIX variable in libopenabe-1.0.0/Makefile.

Mac OS X

Note that for Mac OS X, you will need homebrew installed prior to running the deps/install_pkgs.sh script. Then, do the following (you may require sudo on the second step):

cd libopenabe-1.0.0/
./deps/install_pkgs.sh

Note that you only have to do this once per system setup. After completion, you can proceed to compile the OpenABE as follows:

. ./env
make
make test

All the unit tests should pass at this point and you can proceed to install the OpenABE in a standard location (/usr/local) as follows:

sudo -E make install

To change the installation path prefix, modify the INSTALL_PREFIX variable in libopenabe-1.0.0/Makefile.

Windows

To build OpenABE on Windows 7, 8, and 10, you will need to download and install Mingw-w64, the GNU toolchain port for building Windows-native binaries. We use the Mingw-w64 port packaged with Minimal SYStem 2 (MSYS2). MSYS2 is an emulated POSIX-compliant environment for building software with GNU tooling (e.g., GCC), bash, and package management using Arch Linux's Pacman. Binaries compiled with these compilers do not require cygwin.dll as they are standalone.

  1. Download msys2-x86_64-latest.exe and run it. Select C:\ for the installation directory to avoid PATH resolution problems.

  2. Launch the MSYS2 shell and execute the following command:

     update-core
    
  3. Close the MSYS2 shell and launch the MinGW-w64 Win64 Shell. Note that after starting MSYS2, the prompt will indicate which version you have launched.

  4. Update the pre-installed MSYS2 packages (and install related tooling), close the shell when prompted to, and relaunch the MinGW-w64 Win64 Shell. Execute the following command to start the process:

     pacman -Sy
     pacman -Su base-devel unzip git wget mingw-w64-i686-toolchain \
     mingw-w64-x86_64-toolchain mingw-w64-i686-cmake mingw-w64-x86_64-cmake
    
  5. Install the required third-party libraries by executing the following command:

     pacman -S gmp-devel mingw-w64-i686-boost mingw-w64-x86_64-boost \
     mingw-w64-x86_64-gtest mingw-w64-i686-gtest
    
  6. In the libopenabe directory, execute the following:

     . ./env
     make
     make test
    
  7. If all the unit tests pass, then proceed to install the library in a standard location:

      make install
    

Android

To build OpenABE for Android, you will need to download and install the Android NDK. The NDK is a toolset that enables cross-compiling C and C++ for ARM and Android-specific libraries and implementations of standard libraries (e.g., GNU STL). We use Android NDK r10e and build on Debian 7.

Download the Android NDK r10e at the following links:

  1. For Windows-x86_64
  2. For Darwin/Mac OS X-x86_64
  3. For Linux-x86_64

Unzip the NDK to a directory of your choice. We unzip it to /opt/android-ndk-r10e/ and will refer to this as $ANDROID_NDK_ROOT hereafter.

We build all libraries outside of the OpenABE deps directory. We export the following variables to streamline and contain the build process with a standalone toolchain:

export TOOLCHAIN_ARCH=arm-linux-androideabi-4.8 
export MIN_PLATFORM=android-14
export INSTALLDIR=$HOME/android

With these variables set, you can now make the standalone toolchain:

$ANDROID_NDK_ROOT/build/tools/make-standalone-toolchain.sh \
	--toolchain=$TOOLCHAIN_ARCH --llvm-version=3.6 \
	--platform=$MIN_PLATFORM --install-dir=$INSTALLDIR

Note that 32- and 64-bit architectures are supported for any platform API greater than android-14; However, 64-bit is not supported in the RELIC library for ARM-based processors.

To build for Android, run the following:

./platforms/android.sh $ANDROID_NDK_ROOT $INSTALLDIR

In the libopenabe directory, execute the following:

. ./env $ANDROID_NDK_ROOT $INSTALLDIR
make src

Quick Start

To compile example C++ apps that use the high-level OpenABE crypto box API, do the following:

. ./env
make examples
cd examples/

Then, execute the test apps for each mode of encryption supported:

./test_kp
./test_cp
./test_pk

You can also execute the example that demonstrates use of the keystore with ABE decryption:

./test_km

Benchmarking

The OpenABE is built on top of the abstract Zeutro Math library which supplies all of our elliptic-curve operations. We instantiate our schemes using the state-of-the-art Barreto-Naehrig (BN) curves with the embedding degree k = 12 (or commonly referred to as BN-254). This particular asymmetric curve is known to yield a very efficient pairing implementation and a security level equivalent to AES-128. As a result, this boosts the overall performance of ABE scheme implementations over prior efforts. Other benefits of BN curves include the ability to compress the representation of group elements. This directly translates to making ABE ciphertexts more compact which considerably reduces transmission costs.

We include a benchmark utility for all the ABE schemes provided in the OpenABE:

Math Library: RELIC
OpenABE benchmark utility, v1.0
Usage bench_libopenabe: [ scheme => 'CP' or 'KP' ] [ iterations ] \
               [ attributes ] [ 'fixed' or 'range' ] [ 'cpa' or 'cca']
-scheme: the type of ABE scheme to benchmark
-iterations: the number of iterations per test
-attributes: the number of attributes in the policy or \
                 attribute list for encryption
-'fixed' or 'range': run with a fixed number of attributes \
                     or as a range from 1 to num. attributes
-'cpa' or 'cca': chosen-plaintext secure vs chosen-ciphertext \
                 secure versions

For example, the command below shows how to benchmark the CCA-secure KP-ABE implementation with 100 attributes for encryption (averaged over 10 iterations). Moreover, the generated decryption key policy will have 100 attributes and each attribute will be involved in the decryption.

cd src
bench_libopenabe KP 10 100 fixed cca

Contributions

Cryptographic Design

  • Brent Waters
  • Matthew Green
  • Susan Hohenberger Waters
  • J. Ayo Akinyele

Software Design and Development

  • J. Ayo Akinyele
  • Matthew D. Green
  • Alan M. Dunn
  • Michael Rushanan

Copyright and License

Copyright (c) 2020 Zeutro, LLC. All rights reserved.

OpenABE is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

OpenABE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You can be released from the requirements of the GNU Affero General Public License and obtain additional features by purchasing a commercial license. Buying such a license is mandatory if you engage in commercial activities involving OpenABE that do not comply with the open source requirements of the GNU Affero General Public License.

openabe's People

Contributors

brent-zeutro avatar fklement avatar jakinyele avatar matthewdgreen avatar pekedevil avatar suezeu avatar svituz avatar yufengzh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openabe's Issues

certificate error when installing dependency gtest

While it's not the problem with our codebase, I want to raise awareness to address possible failure when installing dependency.

I tried on multiple Ubuntu instances and it seems that Ubuntu 18.04 does not have the root CA that Github is using.

I added the --no-check-certificate in my forked version, but maybe we can consider downloading gtest from somewhere else?

OpenABE in Raspberry

Hello,

Is it possible to install and use this library in a Raspberry with raspbian? I am trying to install it but the make command is giving me errors related to relic.

Thanks you

ubuntu 16.04 got Makefile:137: recipe for target 'keys/zpkey.o' failed

zscanner.cpp: In member function ‘int OpenABEFlexLexer::yy_get_next_buffer()’:
zscanner.cpp:1308:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((int) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
^
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zml/zgroup.cpp
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zml/zpairing.cpp
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zml/zelliptic.cpp
gcc -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/root/include -fPIC -g -O2 -DSSL_LIB_INIT -Wno-implicit-function-declaration -c zml/zelement.c -o zelement.o
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zml/zelement_ec.cpp
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zml/zelement_bp.cpp
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c keys/zkdf.cpp
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c keys/zkey.cpp
g++ -I/home/xanarry/Desktop/openabe-master/deps/root/include -I/home/xanarry/Desktop/openabe-master/src -I/home/xanarry/Desktop/openabe-master/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c keys/zpkey.cpp
In file included from /home/xanarry/Desktop/openabe-master/deps/root/include/openssl/pem.h:22:0,
from /home/xanarry/Desktop/openabe-master/root/include/openabe/keys/zpkey.h:38,
from /home/xanarry/Desktop/openabe-master/root/include/openabe/openabe.h:135,
from keys/zpkey.cpp:39:
keys/zpkey.cpp: In constructor ‘oabe::OpenABEPKey::OpenABEPKey(const EC_KEY*, bool, EC_GROUP*)’:
/home/xanarry/Desktop/openabe-master/deps/root/include/openssl/evp.h:444:48: error: invalid conversion from ‘const void*’ to ‘void*’ [-fpermissive]
(eckey))
^
keys/zpkey.cpp:72:5: note: in expansion of macro ‘EVP_PKEY_assign_EC_KEY’
EVP_PKEY_assign_EC_KEY(this->pkey, ec_key);
^
/home/xanarry/Desktop/openabe-master/deps/root/include/openssl/evp.h:1111:5: note: initializing argument 3 of ‘int EVP_PKEY_assign(EVP_PKEY*, int, void*)’
int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);
^
Makefile:137: recipe for target 'keys/zpkey.o' failed
make[1]: *** [keys/zpkey.o] Error 1
make[1]: Leaving directory '/home/xanarry/Desktop/openabe-master/src'
Makefile:19: recipe for target 'src' failed
make: *** [src] Error 2

Tries to pull already-present dependencies

MacOS Catalina 10.15.6, Xcode-12.0.

Two problems.

  1. openabe ignores OpenSSL-1.1.1g that's installed in /opt/local, and tries to download and install another copy. I need to be able to tell it to use the existing build.

  2. openabe build tries to use system-provided sed, which on macOS is old and bad. I have GNU sed gsed installed - but found no way of telling openabe to use it instead.

ERROR oucur when make install

hello,that's another problem:
the directory ./deps/root/bin is not created, so I have to create it by myself to avoid this error when execute make install :

cp: cannot stat '/home/won/GitHub/openabe/deps/root/bin': No such file or directory Makefile:32: recipe for target 'install-deps' failed make: *** [install-deps] Error 1

Compile command may not work in some environment

It should be

source ./env

Instead of

../env

At least on Ubuntu 18.04 LTS.

By the way, when installing gtest, wget may fail if ca-certficate not installed but it still proceed with a empty .zip file, and ./bin will not be created, which results in an error when executing unzip during compilation. However make clean ignore those corrupted or empty files, which makes reinstall even harder in those cases.

File cannot create directory: /deps/root/lib. Maybe need administrative privileges.

Hello,
When I try to install openabe-master on Mac, after the /make steps, it pops out the error:
CMake Error at cmake_install.cmake:36 (file):
file cannot create directory: /deps/root/include/relic_ec. Maybe need
administrative privileges.

make[2]: *** [install] Error 1
make[1]: *** [relic-toolkit-0.4.1h/.built] Error 2

And finally:
CMake Error at cmake_install.cmake:36 (file):
file cannot create directory: /deps/root/lib. Maybe need administrative
privileges.

make[2]: *** [install] Error 1
make[1]: *** [googletest-release-1.8.0/.built] Error 2
make: *** [all] Error 2

Any idea about this?

Is it possible to check if key can decrypt ciphertext?

I would like to know there is it possible to check if a key can decrypt ciphertext without trying to decrypt it.

I know that, trying to decrypt a ciphertext with unauthorized key generates an error. So we can assume that the policy is not satisfied. But I need more proper way to do it.

Centos dependency updates

The following centos dependencies should be updated as there are not packages with the current name.

python3 => python36
python3-setuptools => python36-setuptools
python3-devel => python36-devel
python3-pip => python36-pip

Problems running tests before installation, plus misc.

MacOS, current master.

  1. Building with at least one dependency (e.g., relic) enabled - make test fails if said dependency isn't already installed.
  2. make clean does not remove test and debug artifacts, does not remove built library and header files from $ZROOT/root/.
  3. Everything is linked with shared libraries for dependencies (static and shared vars both point at "shared").

All of the above is fixed in PR #49 .

Issues building for android

Hello.

We are a group of students attempting to use OpenABE for a team project, requiring us to build the project for Linux as well as Android.

Following your build instructions, we were able to build the project for Linux without too many problems, the test examples appear to work properly. 2 small issues we encountered:

  • Makefile.common has cc=g++, causing an error, fixed by setting it to gcc.
  • download_gtest.sh occasionally fails downloading, fixed by adding --no-check-certificate to the wgets call.

Building it for android proved to be much more difficult, we ran into various issues with the android.sh script, many of which we were able to fix (we think), by changing the script or the environment variables. Details below.

Currently, the script appears to install the requirements properly, but when making the project via make src, many required header files seem to be missing or in incorrect locations. This might very well be caused by our modifications.
Error message:
"/(home)/openabe/root/include/openabe/zml/zelement.h:47:11: fatal error: relic/relic.h: No such file or directory
#include <relic/relic.h>
"
Adding an include for the correct location of the relic.h or copying it to an already included location causes hundreds of similar error messages for all kinds of header files.

We are unsure what causes this issue and how to fix it. The requirements might not be installed properly, maybe caused by our modifications. The linker might not properly link the libraries. Or maybe we're just missing some includes. Any insight you could provide would be helpful.


If we instead first attempt to build the project for Linux within the same folder, the headers do exist at the correct locations. If we now perform the build process for android again in the same folder, make src builds the project, and the tests work. However, we are not sure if we did build the project for android at that point, or some sort of bastardized Linux version. Or are you supposed to build the project for Linux first, before you even start to build it for android? This would fix some of the issues with the build process for android we encountered. We did not test this version on an actual android system.

Specifications:
Ubuntu 18.04.2
Android NDK r10e
GMP 6.0.0
Relic toolkit 0.5.0
OpenSSL 1.1.1
gtest 1.8.0
target arch: armv7-a

Modifications to the android.sh and the build process in general:

  • android.sh doesn't automatically download OpenSSL, Relic or gtest, so perform their download scripts first.
  • android.sh uses environment variables setup in your env file, so we setup the environment before starting android.sh
  • we run android.sh using clang. gcc produced various issues, especially with relic. However clang didn't work with OpenSSL, so:

OpenSSL:

  • we build OpenSSL by itself before running the android.sh script using gcc. We were unable to build it with clang.
  • Run Configure android-arm instead of just android. android by itself doesn't seem to be a valid option.
  • additional flags for OpenSSL Configure: -latomic -march=armv7-a -mthumb -Dchar16_t=uint16_t -Dchar32_t=uint32_t
    we were getting compiler errors about atomic library calls, requiring thumb2 instructions, and some custom variable types to not exist. Running configure with these flags fixed the issues.

android.sh:

  • changed lib versions as instructed
  • skip OpenSSL building, since we did that seperately
  • line 116: RANLIB="/bin/true" to RANLIB="$TOOLCHAIN_ARCH-ranlib"
  • line 197 and 207: -DWORD to -DWSIZE (Relic replaced WORD with WSIZE)
  • gtest: modified generated Android.mk file, it didn't seem to use the correct folder structure and includes
    starting line 269:
    echo "
    LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_CPP_EXTENSION := .cc
    LOCAL_MODULE := libgtest
    LOCAL_C_INCLUDES := $(LOCAL_PATH)/../googletest/include . $(LOCAL_PATH)/../googletest/ .
    LOCAL_SRC_FILES := ../googletest/src/gtest-all.cc
    include $(BUILD_SHARED_LIBRARY)
    " > ./jni/Android.mk

Any help would be greatly appreciated.

Build with BP_WITH_OPENSSL fails - missing bp.h

OpenSSL-1.1.1 and 3.0 (and 1.0.2 - I checked) do not have bp.h header file.

src/include/openabe/zml/zelement.h tries to include bp.h. which fails:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src
CXX11FLAGS: -std=c++11 -I/Users/ur20980/src/openabe-mouse/deps/root/include -I/Users/ur20980/src/openabe-mouse/src -I/Users/ur20980/src/openabe-mouse/root/include -std=c++11 -I/opt/local/include -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-deprecated -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2  -DSSL_LIB_INIT -DBP_WITH_OPENSSL 
mkdir -p /Users/ur20980/src/openabe-mouse/root/include/openabe
cp -r include/openabe/* /Users/ur20980/src/openabe-mouse/root/include/openabe
clang++ -I/Users/ur20980/src/openabe-mouse/deps/root/include -I/Users/ur20980/src/openabe-mouse/src -I/Users/ur20980/src/openabe-mouse/root/include -std=c++11 -I/opt/local/include -stdlib=libc++ -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-deprecated -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2  -DSSL_LIB_INIT -DBP_WITH_OPENSSL -c zobject.cpp
In file included from zobject.cpp:39:
In file included from /Users/ur20980/src/openabe-mouse/root/include/openabe/openabe.h:120:
/Users/ur20980/src/openabe-mouse/root/include/openabe/zml/zelement.h:43:10: fatal error: 'openssl/bp.h' file not found
#include <openssl/bp.h>
         ^~~~~~~~~~~~~~
1 error generated.
make[1]: *** [zobject.o] Error 1

How to trigger this bug:

$ . ./env
$ export ZML_LIB="with_openssl"
$ make
. . . . .
[ observe the above error message ]

Seems the same as #15, only with more details. ;-)

@jakinyele any help here? Is ZML_LIB="with_openssl" deprecated? Because I don't see how this can even compile, and OpenSSL stopped providing openssl/bp.h header file (and the rest of support) way before v1.0.2. So, this must be a really old relict.

What happened to MA?

The Zeutro web site used to mention supporting multi-authority with a ZerotroSDK. It wasn't open source but I don't see it there anymore. Is it just gone? Is it going to be rolled into OpenABE?

make issue when running bison -d -v zparser.yy

Hi, I am trying to install the package on Ubuntu 18.04. I caught the error when running the make command. The following is the error info.

mkdir -p /home/ubuntu/openabe/root/include/openabe cp -r include/openabe/* /home/ubuntu/openabe/root/include/openabe g++ -I/home/ubuntu/openabe/deps/root/include -I/home/ubuntu/openabe/src -I/home/ubuntu/openabe/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zobject.cpp g++ -I/home/ubuntu/openabe/deps/root/include -I/home/ubuntu/openabe/src -I/home/ubuntu/openabe/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c openabe.cpp g++ -I/home/ubuntu/openabe/deps/root/include -I/home/ubuntu/openabe/src -I/home/ubuntu/openabe/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zcontext.cpp g++ -I/home/ubuntu/openabe/deps/root/include -I/home/ubuntu/openabe/src -I/home/ubuntu/openabe/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zcrypto_box.cpp g++ -I/home/ubuntu/openabe/deps/root/include -I/home/ubuntu/openabe/src -I/home/ubuntu/openabe/root/include -std=c++11 -fPIC -DGTEST_USE_OWN_TR1_TUPLE=0 -pthread -Wall -fstrict-overflow -Wsign-compare -g -O2 -DSSL_LIB_INIT -c zsymcrypto.cpp bison -d -v zparser.yy zparser.yy: warning: 3 shift/reduce conflicts [-Wconflicts-sr] zparser.yy:42.9-24: error: %define variable 'api.parser.class' is not used %define api.parser.class {Parser} ^^^^^^^^^^^^^^^^ Makefile:58: recipe for target 'zparser.o' failed

--with-default-names removed from Homebrew

Homebrew does not support the option --with-default-names any more.

As a result, the install_pkgs.sh script does not work as intended any more.

Possible fix: Add gnu_sed to $PATH.

Pyopenabe throws the unwrapped exception UnicodeDecodeError when trying to encrypt the ciphertext '\x80'.

Pyopenabe throws the unwrapped exception UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0 when trying to encrypt the ciphertext '\x80'.

Here is the simplest case I can find to reproduce the error:

import pyopenabe

print("Testing Python bindings for PyOpenABE...")
openabe = pyopenabe.PyOpenABE()
cpabe = openabe.CreateABEContext("CP-ABE")
pt1 = b"\x80"
ct = cpabe.encrypt("((one or two) and three)", pt1)

And here is the traceback:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    ct = cpabe.encrypt("one", pt1)
  File "pyopenabe.pyx", line 162, in pyopenabe.PyABEContext.encrypt
  File "pyopenabe.pyx", line 90, in pyopenabe.to_bytes
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 0: ordinal not in range(128)

Python version: sys.version_info(major=2, minor=7, micro=12, releaselevel='final', serial=0)
OpenABE version: 1.0.0

Cannot build anything on Mac

Multiple problems. Mainly, the build scripts fail to pick a usable compiler (from the three installed and working!).

Compilers:

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin19/10.2.0/lto-wrapper
Target: x86_64-apple-darwin19
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc10/gcc10/work/gcc-10.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin19 --enable-languages=c,c++,objc,obj-c++,lto,fortran,jit --libdir=/opt/local/lib/gcc10 --includedir=/opt/local/include/gcc10 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-10 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-10 --with-gxx-include-dir=/opt/local/include/gcc10/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --enable-host-shared --disable-tls --with-pkgversion='MacPorts gcc10 10.2.0_1' --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (MacPorts gcc10 10.2.0_1) 
$ clang++ -v
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ clang -v
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Error attempting to build the relic dependency:

$ make
./download_relic.sh relic-toolkit-0.5.0
Clone github repo @ https://github.com/relic-toolkit/relic
fatal: destination path 'relic-toolkit-0.5.0.git' already exists and is not an empty directory.
HEAD is now at b984e901 Update LABEL with recent changes.
Create archive of source (without git files)
Create final tarball: relic-toolkit-0.5.0.tar.gz
mkdir: relic-toolkit-0.5.0: File exists
Fix symbols...
tar xf relic-toolkit-0.5.0.tar.gz
cd tmpbp-gMIo; \
	 COMP="-O2 -funroll-loops -fomit-frame-pointer -Wno-incompatible-pointer-types -Wno-unused-function -Wno-implicit-function-declaration -Wno-incompatible-pointer-types-discards-qualifiers" cmake  -DCMAKE_INSTALL_PREFIX:PATH=/Users/ur20980/src/openabe/deps/root -DOPSYS=MACOSX -DARCH="X64" \
	-DWITH="BN;DV;FP;FPX;EP;EPX;PP;PC;MD" -DCHECK=off -DVERBS=off -DDEBUG=off -DMULTI=PTHREAD -DBENCH=0 -DTESTS=10 -DARITH=x64-asm-254 -DFP_PRIME=254 -DBN_PRECI=254 \
	-DFP_QNRES=on -DEP_METHD="PROJC;LWNAF;COMBS;INTER" -DFP_METHD="BASIC;COMBA;COMBA;MONTY;LOWER;SLIDE" -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP" \
	-DSEED="ZERO" -DRAND="CALL" ../relic-toolkit-0.5.0; \
	make && \
	make install && \
	cd ../tmpec-mVH9; \
	 COMP="-O2 -funroll-loops -fomit-frame-pointer -Wno-unused-function -Wno-implicit-function-declaration -Wno-incompatible-pointer-types-discards-qualifiers" cmake  -DCMAKE_INSTALL_PREFIX:PATH=/Users/ur20980/src/openabe/deps/root -DOPSYS=MACOSX -DARCH="X64" \
	-DWITH="BN;DV;FP;EP;MD" -DCHECK=off -DVERBS=off -DDEBUG=off -DMULTI=PTHREAD -DBENCH=0 -DTESTS=0 -DARITH=gmp -DFP_PRIME=256 \
	-DFP_QNRES=off -DEP_METHD="PROJC;LWNAF;COMBS;INTER" -DFP_METHD="BASIC;COMBA;COMBA;MONTY;LOWER;SLIDE" -DFPX_METHD="INTEG;INTEG;LAZYR" -DPP_METHD="LAZYR;OATEP" \
	-DSEED="ZERO" -DRAND="CALL" -DLABEL="ec" ../relic-toolkit-0.5.0; \
	make && \
	make install && \
	sed -i -e '/^#define VERSION/d' /Users/ur20980/src/openabe/deps/root/include/relic/relic_conf.h && \
	sed -i -e '/^#define ep2_mul/i \
//#define ep2_mul' /Users/ur20980/src/openabe/deps/root/include/relic/relic_label.h && \
	sed -i -e '/^#define VERSION/d' /Users/ur20980/src/openabe/deps/root/include/relic_ec/relic_conf.h && \
	../run_install_clean.sh && \
	touch ../relic-toolkit-0.5.0/.built
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/local/bin/g++
-- Check for working C compiler: /opt/local/bin/g++ - broken
CMake Error at /opt/local/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/opt/local/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/opt/local/bin/gmake cmTC_3cb7e/fast && gmake[1]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    /opt/local/bin/gmake  -f CMakeFiles/cmTC_3cb7e.dir/build.make CMakeFiles/cmTC_3cb7e.dir/build
    gmake[2]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_3cb7e.dir/testCCompiler.c.o
    /opt/local/bin/g++   -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk  -o CMakeFiles/cmTC_3cb7e.dir/testCCompiler.c.o -c /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c
    cc1plus: warning: command-line option '-std=gnu17' is valid for C/ObjC but not for C++
    /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c:2:3: error: #error "The CMAKE_C_COMPILER is set to a C++ compiler"
        2 | # error "The CMAKE_C_COMPILER is set to a C++ compiler"
          |   ^~~~~
    gmake[2]: *** [CMakeFiles/cmTC_3cb7e.dir/build.make:85: CMakeFiles/cmTC_3cb7e.dir/testCCompiler.c.o] Error 1
    gmake[2]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    gmake[1]: *** [Makefile:140: cmTC_3cb7e/fast] Error 2
    gmake[1]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeOutput.log".
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeError.log".
make[1]: *** No targets specified and no makefile found.  Stop.
-- The C compiler identification is unknown
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /opt/local/bin/g++
-- Check for working C compiler: /opt/local/bin/g++ - broken
CMake Error at /opt/local/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
  The C compiler

    "/opt/local/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/opt/local/bin/gmake cmTC_a54df/fast && gmake[1]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    /opt/local/bin/gmake  -f CMakeFiles/cmTC_a54df.dir/build.make CMakeFiles/cmTC_a54df.dir/build
    gmake[2]: Entering directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_a54df.dir/testCCompiler.c.o
    /opt/local/bin/g++   -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk  -o CMakeFiles/cmTC_a54df.dir/testCCompiler.c.o -c /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c
    cc1plus: warning: command-line option '-std=gnu17' is valid for C/ObjC but not for C++
    /Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp/testCCompiler.c:2:3: error: #error "The CMAKE_C_COMPILER is set to a C++ compiler"
        2 | # error "The CMAKE_C_COMPILER is set to a C++ compiler"
          |   ^~~~~
    gmake[2]: *** [CMakeFiles/cmTC_a54df.dir/build.make:85: CMakeFiles/cmTC_a54df.dir/testCCompiler.c.o] Error 1
    gmake[2]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    gmake[1]: *** [Makefile:140: cmTC_a54df/fast] Error 2
    gmake[1]: Leaving directory '/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeTmp'
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeOutput.log".
See also "/Users/ur20980/src/openabe/deps/relic/tmpbp-gMIo/CMakeFiles/CMakeError.log".
make[1]: *** No targets specified and no makefile found.  Stop.
make: *** [relic-toolkit-0.5.0/.built] Error 2

The option '-k' of the command oabe_dec for PKE is wrong, it should be '-r'.

Thanks for your project, it is very easy to use for someone who is not a encryption expert like me. And I found a small question:

The option '-k' of the command oabe_dec for PKE is wrong, it should be '-r'.

won@ubuntu:~/GitHub/openabe_test_pke$ oabe_dec 
OpenABE command-line: decryption utility, v1.7
usage: [ -s scheme ] [ -p prefix ] [ -k key ] [ -i ciphertext ] [ -o output ] -v

	-v : turn on verbosity
	-s : scheme types are 'PK', 'CP' or 'KP'
	-k : recipient key Id for 'PK' and secret key file for 'CP'/'KP'
	-e : sender key Id for 'PK'
	-i : ciphertext file 
	-o : output file for plaintext
	-p : prefix for generated authority public and secret parameter files (optional)

won@ubuntu:~/GitHub/openabe_test_pke$ 
won@ubuntu:~/GitHub/openabe_test_pke$ oabe_dec -s PK -k Bob -e Alice -i test.pkenc -o test_Bob.txt
ciphertext: test.pkenc
missing sender ID (-e option) and/or recipient ID (-r option)
won@ubuntu:~/GitHub/openabe_test_pke$ 
won@ubuntu:~/GitHub/openabe_test_pke$ oabe_dec -s PK -r Bob -e Alice -i test.pkenc -o test_Bob.txt
ciphertext: test.pkenc

Make command returns error in ubuntu 18.04

hi
i am installing the library using your guide on github
it throws error when i try to make the library
after the MAKE command is issued, the following error display on screen
image

AES of openABE's performance is not normal

When encrypt and decrypt large files using AES of openABE, it costs a lot of time than normal AES. Here is the performance I debugeed:
decrypt: EVP_DecryptInit_ex0.002 ms
decrypt: EVP_DecryptUpdate 1 0 ms
decrypt: EVP_DecryptUpdate 2 50.797 ms
decrypt: pt_buf.appendArray 89.899 ms
decrypt: EVP_CIPHER_CTX_ctrl0.002 ms
decrypt: pt_buf.toString() 2006.45 ms
decrypt: 2212.04 ms

This is because openABE use its own string type "OpenABEByteString". Its toString API and appendArray cost a lot of time.

So I have a question: in the following API

OpenABE_ERROR
OpenABESymKeyAuthEnc::encrypt(const string& plaintext, OpenABEByteString *iv, OpenABEByteString *ciphertext, OpenABEByteString *tag)
{

bool
OpenABESymKeyAuthEnc::decrypt(string& plaintext, OpenABEByteString* iv, OpenABEByteString* ciphertext, OpenABEByteString* tag)
{

Why not use standard string instead of OpenABEByteString?

Thanks in advance

RELIC dependency

This is more a question than an issue. I was looking at the dependency on RELIC and was a little concerned about this statement on their github page.

"RELIC is at most alpha-quality software. Implementations may not be correct or secure and may include patented algorithms. There are many configuration options which make the library horribly insecure. Backward API compatibility with early versions may not necessarily be maintained. Use at your own risk."

Would there be any problem bumping the dependency to the latest commit or is there something special about that particular commit? It as almost a year ago and there appear to be quite a few commits since then.

Can you comment on its use withing OpenABE?

Ubuntu-based system installation problem

I tried to install openabe-master on Ubuntu machine, everything is OK at the beginning (make / make test steps). However, after the /sudo make install, there is the error: Makefile:7 *** ZROOT is undefined. Need to source env file: . ./env. And after trying . ./env there is no difference.
Any hints?

ABE attribute values as plain strings

Hi,

I'm using OpenABE for a project on access control for web/cloud APIs.

From the OpenABE manual (CLI), I've noted the sentence: "Attributes also includes printable symbols/characters such as $, &, #, % and so on." This seems not the case, however, for sign "+".

For example, I've an attribute representing an email address (yes, I know it is a particular one:) and I'm trying to generate a KP ABE key:

oabe_keygen -s KP -p test -o key -i email:[email protected]

which results in the following CLI error:

Driver::error string stream:1.53: syntax error, unexpected $undefined, expecting end of file
./keygen.cpp:runAbeKeygen:119: 'Invalid function input'

Same result using quotes to delimit the value, i.e.

oabe_keygen -s KP -p test -o key -i email:"[email protected]"

EDIT: this happens with other signs which are operators such as ">", "<", "=", space, single and double quotes.

Is there a way to tell the underlying parser that the value of an attribute should be interpreted as a plain string?

Thanks,
Giovanni

attribute negation

Attribute negation in policies seem possible in literature.
e.g. (attr1 AND NOT attr2)

As far as I have seen, this does not seem to be implemented in OpenABE.
Is it planned at some point ?

Fail Build On Window

hi, I want to build openabe on windows and I get the errors as follow:

"glob" is not exported by the File::Glob module
Can't continue after import errors at ./Configure line 18.
BEGIN failed--compilation aborted at ./Configure line 18.
make[2]: *** [Makefile:14:openssl-1.1.1-dev-bp/.built] 错误 255
make[2]: 离开目录“/f/project/libopenabe-1.0.0/deps/openssl”
make[1]: *** [Makefile:9:all] 错误 2
make[1]: 离开目录“/f/project/libopenabe-1.0.0/deps”
make: *** [Makefile:16:deps] 错误 2

any ideas?? thanks

Build fails link on dynamic libraries MacOS 10.14.5

"make" seems to progress well with a number of warning.

g++ -o test_km -std=c++11 -pthread -Wall -g -O2 -DSSL_LIB_INIT -I//Library/ABE/openabe/deps/root/include -I//Library/ABE/openabe/root/include -L//Library/ABE/openabe/deps/root/lib -L//Library/ABE/openabe/root/lib test_km.cpp -lcrypto -lrelic -lrelic_ec -lopenabe

libraries seem in place but
make test
(cd src && ./test_libopenabe) || exit 1
dyld: Library not loaded: @rpath/librelic_ec.dylib
Referenced from: //Library/ABE/openabe/src/./test_libopenabe
Reason: image not found
/bin/sh: line 1: 7442 Abort trap: 6 ./test_libopenabe
make: *** [test] Error 1

centos and fedora dep install does system update

The install_pkgs.sh script, for centos and fedora, does a full system upgrade without confirmation by running yum -y upgrade.

I can understand the desire to have the latest code but it might be a bit much when you're just expecting it to install the required dependencies. I found myself seeing a ton of rpm package upgrades and saying, "whooooooh no way. I'm not prepared for that right now"

I would suggest removing it and only including required packages.

Failed build on Centos7

Build fails with the following error.

zparser.yy:42.9-24: error: %define variable 'api.parser.class' is not used
%define api.parser.class {Parser}
^^^^^^^^^^^^^^^^
make[1]: *** [zparser.o] Error 1
make[1]: Leaving directory `/home/centos/git/openabe/src'
make: *** [src] Error 2

I have bison 3.0.4 installed.

Changing api.parser.class to parser_class_name seems to fix the problem.

Quick Tutorial: CP-ABE example

Hello,
I tried the CP-ABE example in OpenABE Command-line utilities documentation, and the oabe_setup, oabe_kegen part is OK. But the encryption command has error as below.

./oabe_enc -s CP -p org1 -e "((Doctor or Nurse) and (Floor in (2-5)))" \ -i input.txt -o input.cpabe
Could not open file : iostream error

Ciphertext size

Hi,

Which is the smallest resulting ciphertext size that can be obtained when ciphering a 1-digit number with a very simple policy?

Thank you!

Testing issue with ubuntu 20.04

After manually downloading the gtest release-1.8.0.zip, I use sudo -E make build the library. However, When I run with the "make test", some error happened, the first error is as follows:

VirtualBox:~/ABE/openabe/openabe-master$ make test
(cd src && ./test_libopenabe) || exit 1
libopenabe v1.7 test utility.

[==========] Running 46 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 46 tests from libopenabe
[ RUN ] libopenabe.PolicyTreeAndAttributeListParser
Driver::error string stream:1.12-13: syntax error, unexpected OR, expecting end of file
Check if isEqual throws an error correctly

There are a number of other errors in the testing output.

Error when compiling

I want to use openabe for a project of mine.
Unfortunately I'm not able to get it running when following the instructions in the README.md.

Output:

bison -d -v zparser.yy
zparser.yy:39.1-19: warning: deprecated directive, use ‘%define api.prefix {oabe}’ [-Wdeprecated]
   39 | %name-prefix "oabe"
      | ^~~~~~~~~~~~~~~~~~~
zparser.yy:42.9-27: error: syntax error, unexpected string, expecting identifier
   42 | %define "parser_class_name" {Parser}
      |         ^~~~~~~~~~~~~~~~~~~
zparser.yy:58.1-14: warning: deprecated directive, use ‘%define parse.error verbose’ [-Wdeprecated]
   58 | %error-verbose
      | ^~~~~~~~~~~~~~
zparser.yy: warning: fix-its can be applied.  Rerun with option '--update'. [-Wother]
make[1]: *** [zparser.o] Error 1
make: *** [src] Error 2

What am I doing wrong here?

There is a problem about the script 'deps/install_pkgs.sh'

When the script try to upgrade bison, There is no defination for $ZROOT in Ubuntu 18.04, at least in my system I can not find this variable. So I had to use $dpkg -L bison to find where bison is installed. To the end, I had to run the rest of the script manually statement by statement. I think It will be better if you fix it. :)

OpenSSL dependency

What is BP suport? I can see that it refers to the Zeutro fork but wasn't sure what it was. I can't see where the build would ever pass the "with-bp" option to build it though.

Suppress CERR when decyption fails

We need a way to suppress the cerr when encryption fails. This is a normal occurance and if it is not thrown as an error but just goes to cerr, it causes issues.

abe/zcontextcca.cpp:decrypt:613: 'Error occurred during decryption'

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.