diff options
author | Ruan HE <ruan.he@orange.com> | 2015-09-21 17:10:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-09-21 17:10:04 +0000 |
commit | d165264bc24d693c6f3cdfb7fe360a94c9ea91ca (patch) | |
tree | 2abbc4ab66757f3a26c3756dfac9d35b27eff1cd /moon-abe | |
parent | 4894009265c23fe678a8a3f6e7cd68024432a3db (diff) | |
parent | 79dd1189bd8efd0147f9e539b83bdf0cc26a63ea (diff) |
Merge topic 'moon-abe-stable'
* changes:
abe stable
abe stable
Diffstat (limited to 'moon-abe')
30 files changed, 387 insertions, 22 deletions
diff --git a/moon-abe/cpabe-0.11/Makefile b/moon-abe/cpabe-0.11/Makefile index d62f6df5..5d3b3b54 100644 --- a/moon-abe/cpabe-0.11/Makefile +++ b/moon-abe/cpabe-0.11/Makefile @@ -6,13 +6,13 @@ mandir = ${prefix}/share/man CC = gcc CFLAGS = -O3 -Wall \ - -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include \ + -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \ \ -I/usr/include/pbc -I/usr/local/include/pbc \ \ -DPACKAGE_NAME=\"cpabe\" -DPACKAGE_TARNAME=\"cpabe\" -DPACKAGE_VERSION=\"0.11\" -DPACKAGE_STRING=\"cpabe\ 0.11\" -DPACKAGE_BUGREPORT=\"bethenco@cs.berkeley.edu\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_STDDEF_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_VPRINTF=1 -DHAVE_LIBCRYPTO=1 -DHAVE_LIBCRYPTO=1 -DHAVE_STRCHR=1 -DHAVE_STRDUP=1 -DHAVE_MEMSET=1 -DHAVE_GMP=1 -DHAVE_PBC=1 -DHAVE_BSWABE=1 LDFLAGS = -O3 -Wall \ - -L/usr/local/lib -lglib-2.0 \ + -lglib-2.0 \ -Wl,-rpath /usr/local/lib -lpbc \ -lbswabe \ -Wl,-rpath /usr/local/lib -lgmp \ diff --git a/moon-abe/cpabe-0.11/config.status b/moon-abe/cpabe-0.11/config.status index bf9fa81f..38f5b75c 100644..100755 --- a/moon-abe/cpabe-0.11/config.status +++ b/moon-abe/cpabe-0.11/config.status @@ -438,7 +438,7 @@ Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/michel/Documents/Pro/POC/cpabe-0.11' +ac_pwd='/home/wukong/workspace/opnfv-moon/moon-abe/cpabe-0.11' srcdir='.' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. @@ -600,8 +600,8 @@ S["GMP_CFLAGS"]="" S["GLIB_MKENUMS"]="glib-mkenums" S["GOBJECT_QUERY"]="gobject-query" S["GLIB_GENMARSHAL"]="glib-genmarshal" -S["GLIB_LIBS"]="-L/usr/local/lib -lglib-2.0 " -S["GLIB_CFLAGS"]="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include " +S["GLIB_LIBS"]="-lglib-2.0 " +S["GLIB_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include " S["PKG_CONFIG"]="/usr/bin/pkg-config" S["LIBOBJS"]="" S["EGREP"]="/bin/grep -E" diff --git a/moon-abe/cpabe-0.11/configure b/moon-abe/cpabe-0.11/configure index 747f4beb..747f4beb 100644..100755 --- a/moon-abe/cpabe-0.11/configure +++ b/moon-abe/cpabe-0.11/configure diff --git a/moon-abe/cpabe-0.11/cpabe-attrList b/moon-abe/cpabe-0.11/cpabe-attrList Binary files differindex f7b2de62..41b1ef68 100644..100755 --- a/moon-abe/cpabe-0.11/cpabe-attrList +++ b/moon-abe/cpabe-0.11/cpabe-attrList diff --git a/moon-abe/cpabe-0.11/cpabe-dec b/moon-abe/cpabe-0.11/cpabe-dec Binary files differindex 6c09dd69..e8fb8bb0 100644..100755 --- a/moon-abe/cpabe-0.11/cpabe-dec +++ b/moon-abe/cpabe-0.11/cpabe-dec diff --git a/moon-abe/cpabe-0.11/cpabe-enc b/moon-abe/cpabe-0.11/cpabe-enc Binary files differindex 12d6fbe0..0aefe0c2 100644..100755 --- a/moon-abe/cpabe-0.11/cpabe-enc +++ b/moon-abe/cpabe-0.11/cpabe-enc diff --git a/moon-abe/cpabe-0.11/cpabe-keygen b/moon-abe/cpabe-0.11/cpabe-keygen Binary files differindex 95e8dfff..672deb28 100644..100755 --- a/moon-abe/cpabe-0.11/cpabe-keygen +++ b/moon-abe/cpabe-0.11/cpabe-keygen diff --git a/moon-abe/cpabe-0.11/cpabe-policyList b/moon-abe/cpabe-0.11/cpabe-policyList Binary files differindex d3ec6c6c..9e05c67a 100644..100755 --- a/moon-abe/cpabe-0.11/cpabe-policyList +++ b/moon-abe/cpabe-0.11/cpabe-policyList diff --git a/moon-abe/cpabe-0.11/cpabe-setup b/moon-abe/cpabe-0.11/cpabe-setup Binary files differindex 8fd7bc70..27d34c27 100644..100755 --- a/moon-abe/cpabe-0.11/cpabe-setup +++ b/moon-abe/cpabe-0.11/cpabe-setup diff --git a/moon-abe/cpabe-0.11/install-sh b/moon-abe/cpabe-0.11/install-sh index dd97db7a..dd97db7a 100644..100755 --- a/moon-abe/cpabe-0.11/install-sh +++ b/moon-abe/cpabe-0.11/install-sh diff --git a/moon-abe/cpabe-0.11/master_key b/moon-abe/cpabe-0.11/master_key Binary files differnew file mode 100644 index 00000000..287affea --- /dev/null +++ b/moon-abe/cpabe-0.11/master_key diff --git a/moon-abe/cpabe-0.11/mkinstalldirs b/moon-abe/cpabe-0.11/mkinstalldirs index 6fbe5e11..6fbe5e11 100644..100755 --- a/moon-abe/cpabe-0.11/mkinstalldirs +++ b/moon-abe/cpabe-0.11/mkinstalldirs diff --git a/moon-abe/cpabe-0.11/peks-ind b/moon-abe/cpabe-0.11/peks-ind Binary files differindex 9ffac675..9b492743 100644..100755 --- a/moon-abe/cpabe-0.11/peks-ind +++ b/moon-abe/cpabe-0.11/peks-ind diff --git a/moon-abe/cpabe-0.11/peks-test b/moon-abe/cpabe-0.11/peks-test Binary files differindex 2cc28f5f..03ca4684 100644..100755 --- a/moon-abe/cpabe-0.11/peks-test +++ b/moon-abe/cpabe-0.11/peks-test diff --git a/moon-abe/cpabe-0.11/peks-trap b/moon-abe/cpabe-0.11/peks-trap Binary files differindex 377bcc1e..a7717cc6 100644..100755 --- a/moon-abe/cpabe-0.11/peks-trap +++ b/moon-abe/cpabe-0.11/peks-trap diff --git a/moon-abe/cpabe-0.11/pub_key b/moon-abe/cpabe-0.11/pub_key Binary files differnew file mode 100644 index 00000000..220269e8 --- /dev/null +++ b/moon-abe/cpabe-0.11/pub_key diff --git a/moon-abe/cpabe-0.11/test-lang b/moon-abe/cpabe-0.11/test-lang Binary files differindex 72a452da..89e85781 100644..100755 --- a/moon-abe/cpabe-0.11/test-lang +++ b/moon-abe/cpabe-0.11/test-lang diff --git a/moon-abe/libbswabe-0.9/Makefile b/moon-abe/libbswabe-0.9/Makefile index b81959c3..e476e030 100644 --- a/moon-abe/libbswabe-0.9/Makefile +++ b/moon-abe/libbswabe-0.9/Makefile @@ -6,12 +6,12 @@ includedir = ${prefix}/include CC = gcc CFLAGS = -O3 -Wall \ - -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include \ + -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include \ \ -I/usr/include/pbc -I/usr/local/include/pbc \ -DPACKAGE_NAME=\"libbswabe\" -DPACKAGE_TARNAME=\"libbswabe\" -DPACKAGE_VERSION=\"0.9\" -DPACKAGE_STRING=\"libbswabe\ 0.9\" -DPACKAGE_BUGREPORT=\"bethenco@cs.berkeley.edu\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_VPRINTF=1 -DHAVE_LIBCRYPTO=1 -DHAVE_STRDUP=1 -DHAVE_GMP=1 -DHAVE_PBC=1 LDFLAGS = -O3 -Wall \ - -L/usr/local/lib -lglib-2.0 \ + -lglib-2.0 \ -lgmp \ -lpbc \ -lcrypto diff --git a/moon-abe/libbswabe-0.9/config.status b/moon-abe/libbswabe-0.9/config.status index 87b4e246..5211c65a 100644..100755 --- a/moon-abe/libbswabe-0.9/config.status +++ b/moon-abe/libbswabe-0.9/config.status @@ -438,7 +438,7 @@ Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -ac_pwd='/home/michel/Documents/Pro/POC/libbswabe-0.9' +ac_pwd='/home/wukong/workspace/opnfv-moon/moon-abe/libbswabe-0.9' srcdir='.' test -n "$AWK" || AWK=awk # The default lists apply if the user does not specify any file. @@ -598,8 +598,8 @@ S["GMP_CFLAGS"]="" S["GLIB_MKENUMS"]="glib-mkenums" S["GOBJECT_QUERY"]="gobject-query" S["GLIB_GENMARSHAL"]="glib-genmarshal" -S["GLIB_LIBS"]="-L/usr/local/lib -lglib-2.0 " -S["GLIB_CFLAGS"]="-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include " +S["GLIB_LIBS"]="-lglib-2.0 " +S["GLIB_CFLAGS"]="-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include " S["PKG_CONFIG"]="/usr/bin/pkg-config" S["ALLOCA"]="" S["LIBOBJS"]="" diff --git a/moon-abe/libbswabe-0.9/configure b/moon-abe/libbswabe-0.9/configure index 6f898f0d..6f898f0d 100644..100755 --- a/moon-abe/libbswabe-0.9/configure +++ b/moon-abe/libbswabe-0.9/configure diff --git a/moon-abe/libbswabe-0.9/install-sh b/moon-abe/libbswabe-0.9/install-sh index dd97db7a..dd97db7a 100644..100755 --- a/moon-abe/libbswabe-0.9/install-sh +++ b/moon-abe/libbswabe-0.9/install-sh diff --git a/moon-abe/libbswabe-0.9/libbswabe.a b/moon-abe/libbswabe-0.9/libbswabe.a Binary files differindex ee511111..7a10168d 100644 --- a/moon-abe/libbswabe-0.9/libbswabe.a +++ b/moon-abe/libbswabe-0.9/libbswabe.a diff --git a/moon-abe/libbswabe-0.9/mkinstalldirs b/moon-abe/libbswabe-0.9/mkinstalldirs index 6fbe5e11..6fbe5e11 100644..100755 --- a/moon-abe/libbswabe-0.9/mkinstalldirs +++ b/moon-abe/libbswabe-0.9/mkinstalldirs diff --git a/moon-abe/pbc-0.5.14/Makefile b/moon-abe/pbc-0.5.14/Makefile index 9cce66f3..3c8a39fe 100644 --- a/moon-abe/pbc-0.5.14/Makefile +++ b/moon-abe/pbc-0.5.14/Makefile @@ -333,7 +333,7 @@ PBC_LDFLAGS = RANLIB = ranlib SED = /bin/sed SET_MAKE = -SHELL = /bin/sh +SHELL = /bin/bash STRIP = strip VERSION = 0.5.14 YACC = bison -y diff --git a/moon-abe/pbc-0.5.14/config.status b/moon-abe/pbc-0.5.14/config.status index 9574ddc3..d88df53d 100755 --- a/moon-abe/pbc-0.5.14/config.status +++ b/moon-abe/pbc-0.5.14/config.status @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # Generated by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging @@ -8,7 +8,7 @@ debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=${CONFIG_SHELL-/bin/sh} +SHELL=${CONFIG_SHELL-/bin/bash} export SHELL ## -------------------- ## ## M4sh Initialization. ## @@ -531,10 +531,10 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - set X '/bin/sh' './configure' $ac_configure_extra_args --no-create --no-recursion + set X '/bin/bash' './configure' $ac_configure_extra_args --no-create --no-recursion shift - $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 - CONFIG_SHELL='/bin/sh' + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' export CONFIG_SHELL exec "$@" fi @@ -567,7 +567,7 @@ enable_shared='yes' enable_static='yes' pic_mode='default' enable_fast_install='yes' -SHELL='/bin/sh' +SHELL='/bin/bash' ECHO='printf %s\n' PATH_SEPARATOR=':' host_alias='' @@ -950,7 +950,7 @@ S["PACKAGE_VERSION"]="0.5.14" S["PACKAGE_TARNAME"]="pbc" S["PACKAGE_NAME"]="pbc" S["PATH_SEPARATOR"]=":" -S["SHELL"]="/bin/sh" +S["SHELL"]="/bin/bash" _ACAWK cat >>"$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 diff --git a/moon-abe/pbc-0.5.14/configure b/moon-abe/pbc-0.5.14/configure index 91de4db8..91de4db8 100644..100755 --- a/moon-abe/pbc-0.5.14/configure +++ b/moon-abe/pbc-0.5.14/configure diff --git a/moon-abe/pbc-0.5.14/example/Makefile b/moon-abe/pbc-0.5.14/example/Makefile index 92281781..cff2c302 100644 --- a/moon-abe/pbc-0.5.14/example/Makefile +++ b/moon-abe/pbc-0.5.14/example/Makefile @@ -164,7 +164,7 @@ PBC_LDFLAGS = RANLIB = ranlib SED = /bin/sed SET_MAKE = -SHELL = /bin/sh +SHELL = /bin/bash STRIP = strip VERSION = 0.5.14 YACC = bison -y diff --git a/moon-abe/pbc-0.5.14/gen/Makefile b/moon-abe/pbc-0.5.14/gen/Makefile index 74b288f4..a780fece 100644 --- a/moon-abe/pbc-0.5.14/gen/Makefile +++ b/moon-abe/pbc-0.5.14/gen/Makefile @@ -175,7 +175,7 @@ PBC_LDFLAGS = RANLIB = ranlib SED = /bin/sed SET_MAKE = -SHELL = /bin/sh +SHELL = /bin/bash STRIP = strip VERSION = 0.5.14 YACC = bison -y diff --git a/moon-abe/pbc-0.5.14/libtool b/moon-abe/pbc-0.5.14/libtool index 0e4d39ea..4aa901dd 100755 --- a/moon-abe/pbc-0.5.14/libtool +++ b/moon-abe/pbc-0.5.14/libtool @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # libtool - Provide generalized library-building support services. # Generated automatically by config.status (pbc) 0.5.14 @@ -56,7 +56,7 @@ pic_mode=default fast_install=yes # Shell to use when invoking shell scripts. -SHELL="/bin/sh" +SHELL="/bin/bash" # An echo program that protects backslashes. ECHO="printf %s\\n" diff --git a/moon-abe/python/README.rst b/moon-abe/python/README.rst new file mode 100644 index 00000000..c9d40026 --- /dev/null +++ b/moon-abe/python/README.rst @@ -0,0 +1,365 @@ +Installation +============ + +# This part describes the installation of cpabe and peks. +# You will need to install some official packages that can be +# retrieved online on official repositories. +# You will need to install manually 3 libraries +# Root privileges are required + +# Install official packages: +# build-essebtial and autotools-dev for compilation and installation +# libglib2.0-dev for the glib library +# libgmp3-dev for the GMP library +# flex and bison are necessary for the libbswabe library +# libssl-dev is necessary for the crypto operations + +`sudo apt-get install build-essential autotools-dev libglib2.0-dev libgmp3-dev flex bison libssl-dev` + +# Three libraries have to be installed manually: +# PBC: Pairing Based Cryptography (for pairing operations over elliptic curves) +# More info: http://crypto.stanford.edu/pbc/ +# +# libbswabe: Core operations for cpabe and peks +# More info: http://acsc.cs.utexas.edu/cpabe/ +# +# cpabe: Cyphertext-Policy Attribute Based Encryption library +# Implements the 4 algorithms for CPABE: setup, keygen, enc and dec +# Implements the 4 algorithms for PEKS: setup, enc, trap and test +# More info: http://acsc.cs.utexas.edu/cpabe/ + + +# Replace <PATH-TO-REP> with the path to the POC repository + + +Install pbc +----------- + +* `cd <PATH-TO-REP>/pbc-0.5.14` + +* `./configure` + +* `make` + +* `sudo make install` + +Install libbswabe +----------------- + +* `cd <PATH-TO-REP>/libbswabe-0.9/` + +* `./configure` + +* `make` + +* `sudo make install` + + +Install cpabe +------------- + +* `cd <PATH-TO-REP>/cpabe-0.11/` + +* `./configure` + +* `make` + +* sudo make install + + +Manual +====== + +# Below we describe each functionality of the cpabe and peks: +# For using with the python wrapper, just call ./[PROG-NAME].py [OPTIONS...] ... +# The pythons scripts are in the folder <PATH-TO-REP>/python +# Ex: ./cpabe-setup.py -h +# Some examples are given at the end of this document. + +cpabe-setup: + + Usage: cpabe-setup [OPTION ...] + + Generate system parameters, a public key, and a master secret key + for use with cpabe-keygen, cpabe-enc, and cpabe-dec. + + Output will be written to the files "pub_key" and "master_key" + unless the --output-public-key or --output-master-key options are + used. + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -p, --output-public-key FILE write public key to FILE + + -m, --output-master-key FILE write master secret key to FILE + + -d, --deterministic use deterministic "random" numbers + (only for debugging) + + +cpabe-keygen: + + Usage: cpabe-keygen [OPTION ...] PUB_KEY MASTER_KEY ATTR [ATTR ...] + + Generate a key with the listed attributes using public key PUB_KEY and + master secret key MASTER_KEY. Output will be written to the file + "priv_key" unless the -o option is specified. + + Attributes come in two forms: non-numerical and numerical. Non-numerical + attributes are simply any string of letters, digits, and underscores + beginning with a letter. + + Numerical attributes are specified as `attr = N', where N is a non-negative + integer less than 2^64 and `attr' is another string. The whitespace around + the `=' is optional. One may specify an explicit length of k bits for the + integer by giving `attr = N#k'. Note that any comparisons in a policy given + to cpabe-enc(1) must then specify the same number of bits, e.g., + `attr > 5#12'. + + The keywords `and', `or', and `of', are reserved for the policy language + of cpabe-enc (1) and may not be used for either type of attribute. + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -o, --output FILE write resulting key to FILE + + -d, --deterministic use deterministic "random" numbers + (only for debugging) + + +cpabe-enc: + + Usage: cpabe-enc [OPTION ...] PUB_KEY FILE [POLICY] + + Encrypt FILE under the decryption policy POLICY using public key + PUB_KEY. The encrypted file will be written to FILE.cpabe unless + the -o option is used. The original file will be removed. If POLICY + is not specified, the policy will be read from stdin. + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -k, --keep-input-file don't delete original file + + -o, --output FILE write resulting key to FILE + + -d, --deterministic use deterministic "random" numbers + (only for debugging) + + + +cpabe-dec: + + Usage: cpabe-dec [OPTION ...] PUB_KEY PRIV_KEY FILE + + Decrypt FILE using private key PRIV_KEY and assuming public key + PUB_KEY. If the name of FILE is X.cpabe, the decrypted file will + be written as X and FILE will be removed. Otherwise the file will be + decrypted in place. Use of the -o option overrides this + behavior. + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -k, --keep-input-file don't delete original file + + -o, --output FILE write output to FILE + + -d, --deterministic use deterministic "random" numbers + (only for debugging) + + + +cpabe-policyList: + + Usage: cpabe-policyList [OPTION ...] PUB_KEY CIPHERTEXT + + Print the access policy of a ciphertext CIPHERTEXT + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -d, --deterministic use deterministic "random" numbers + (only for debugging) + + +cpabe-attrList: + + Usage: cpabe-attrList [OPTION ...] PUB_KEY PRV_KEY + + Print the attributes of a private key PRV_KEY + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -d, --deterministic use deterministic "random" numbers + (only for debugging) + + +peks-ind: + + Usage: peks-index [OPTION ...] PUB_KEY IND + + Generate an encrypted index given a clear index IND. + The clear index should be of the form: + keyword_1 + keyword_2 + ... + It uses the public key PUB_KEY and a clear index IND. + The encrypted index will be written to the file "enc_ind" + unless the --output is used. + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -o, --output FILE write index to FILE + + -d, --deterministic use deterministic "random" numbers + + + +peks-trap: + + Usage: peks-trap [OPTION ...] PUB_KEY MSK_KEY KEYWORD + + Generate an encrypted trapdoor given a clear keyword KEYWORD. + It uses the public key PUB_KEY and the master key MSK_KEY. + The encrypted trapdoor will be written to the file "enc_trap" + unless the --output is used. + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -o, --output FILE write index to FILE + + -d, --deterministic use deterministic "random" numbers + + + +peks-test: + + Usage: peks-index [OPTION ...] PUB_KEY IND TRAP + + Test a trapdoor over an encrypted index IND. + It uses the public key PUB_KEY, + an encrypted index IND and an encrypted trapdoor TRAP. + returns 1 if there is a match, 0 if not + + Mandatory arguments to long options are mandatory for short options too. + + -h, --help print this message + + -v, --version print version information + + -d, --deterministic use deterministic "random" numbers + + + +# Examples (See also http://acsc.cs.utexas.edu/cpabe/tutorial.html) +# For using with the python wrapper, just call ./[PROG-NAME].py [OPTIONS...] ... +# The pythons scripts are in the folder <PATH-TO-REP>/python +# Ex: ./cpabe-setup.py + +# Generate master key and public key + $ cpabe-setup + + $ ls + master_key pub_key + +# Generate private key for Sara and Kevin with attributes +# sysadmin, it_department for Sara +# business_staff, strategy_team for Kevin + + $ cpabe-keygen -o sara_priv_key pub_key master_key sysadmin it_department + + $ cpabe-keygen -o kevin_priv_key pub_key master_key business_staff strategy_team + + $ ls + master_key pub_key sara_priv_key kevin_priv_key + +# Encrypt a file security_report.pdf with a policy (business_staff and strategy_team) or (sysadmin and business_staff) + + $ ls + pub_key security_report.pdf + + $ cpabe-enc pub_key security_report.pdf "(sysadmin and business_staff) or (business_staff and strategy_team)" + + $ ls + pub_key security_report.pdf.cpabe + +# Print the policy of the ciphertext + $ ls + pub_key security_report.pdf.cpabe + + $ cpabe-policyList pub_key security_report.pdf.cpabe + business_staff sysadmin 2of2 business_staff strategy_team 2of2 1of2 + +# Print the attributes of Kevin's private key + $ ls + pub_key kevin_priv_key + + $ cpabe-attrList pub_key kevin_priv_key + +# Decryption with Kevin's private key + + $ ls + pub_key kevin_priv_key security_report.pdf.cpabe + + $ cpabe-dec pub_key kevin_priv_key security_report.pdf.cpabe + + $ ls + pub_key kevin_priv_key security_report.pdf + +# Create an encrypted index + + $ ls + pub_key testindex + + $ peks-ind pub_key testindex + + $ ls + enc_ind pub_key testindex + +# Create a trapdoor for the word my_keyword + + $ ls + pub_key master_key + + $ peks-trap pub_key master_key my_keyword + + $ ls + enc_trap pub_key master_key + +# Test if an encrypted index matches with a trapdoor + + $ ls + pub_key enc_ind enc_trap + + $ peks-test pub_key enc_ind enc_trap + + $ echo $? + 0 |