Ciphertext Policy Attribute Based Encryption (CP-ABE) installation in Ubuntu OS

Video is ready, Click Here to View ×


This video is to show how to install Ciphertext Policy Attribute Based Encryption packages in Ubuntu OS. The ‘C’ language is used for implementation.

16 Comments

  1. Hello Sir I am getting this type of error
    policy_lang.y:612:5: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]
    (*l, g_strdup_printf("%s_flexint_%llu", s, value));
    ^
    make: * [policy_lang.o] Error 1

  2. Hi, this was produced after trying to encrypt a text doc 'error parsing policy: trivially satisfied integer comparison hire_date < 946702800
    (any 64-bit number will satisfy)'
    are there any solutions to this?

  3. Hello sir,
    I am getting this error when I tried to follow your instructions to install

    Link of screenshot http://i67.tinypic.com/289llbl.png

    collect2: error: ld returned 1 exit status
    Makefile:34: recipe for target 'cpabe-setup' failed
    make: * [cpabe-setup] Error

    Visited and tried
    https://ubuntuforums.org/showthread.php?t=2254939

    and

    http://stackoverflow.com/questions/17373306/error-in-linking-gmp-while-compiling-cpabe-package-from-its-source-code

    but no luck.

    Help please.

  4. hi nishant,,i get following error,when i run cpabe-setup command

    karthick@karthick-PC/cygdrive/c/cpabe
    $ cpabe-setup
    /usr/local/bin/cpabe-setup.exe: error while loading shared libraries: libbswabe.dll.a: cannot open shared object file: No such file or directory

  5. HI, i trying to compile the last part with the cpabe but after i make "make LDFLAGS="-lgmp -lpbc -lcrypto -L/usr/lib/x86_64-linux-gnu -lglib-2.0 -lbswabe -lgmp"" it shows me that

    policy_lang.y: In function ‘yyparse’:
    policy_lang.y:67:38: error: expected ‘;’ before ‘}’ token
     result: policy { final_policy = $1 }
                                          ^
    policy_lang.y: In function ‘eq_policy’:
    policy_lang.y:212:4: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]
        (g_strdup_printf("%s_flexint_%llu", attr, n->value));
        ^
    policy_lang.y:215:4: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’ [-Wformat=]
        (g_strdup_printf("%s_expint%02d_%llu", attr, n->bits, n->value));
        ^
    policy_lang.y: In function ‘yylex’:
    policy_lang.y:391:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 3 has type ‘uint64_t *’ [-Wformat=]
       sscanf(s->str, "%llu", &(yylval.nat));
       ^
    policy_lang.y: In function ‘parse_attribute’:
    policy_lang.y:577:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 4 has type ‘uint64_t *’ [-Wformat=]
       if( sscanf(a, " %s = %llu # %u ", s, &value, &bits) == 3 )
       ^
    policy_lang.y:596:5: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’ [-Wformat=]
         (*l, g_strdup_printf("%s_expint%02d_%llu", s, bits, value));
         ^
    policy_lang.y:598:3: warning: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 4 has type ‘uint64_t *’ [-Wformat=]
       else if( sscanf(a, " %s = %llu ", s, &value) == 2 )
       ^
    policy_lang.y:612:5: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]
         (*l, g_strdup_printf("%s_flexint_%llu", s, value));
         ^
    Makefile:49: recipe for target 'policy_lang.o' failed
    make: * [policy_lang.o] Error 1

    Does any body can help?

  6. Hi nishant doshi, I need to use this toolkit, since I'm a newbie with Linux I found this tutorial very helpulf. I've followed every single step of your tutorial but at last when I try to compile the cpabe package this error pops out: 
    ~/Downloads/cpabe-0.11$ make
    gcc -c -o setup.o setup.c -O3 -Wall -I/usr/include/glib-2.0 -I/usr/lib/i386-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
    gcc -c -o common.o common.c -O3 -Wall -I/usr/include/glib-2.0 -I/usr/lib/i386-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
    common.c: In function ‘suck_file’:
    common.c:137:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
      fread(a->data, 1, s.st_size, f);
      ^
    common.c: In function ‘read_cpabe_file’:
    common.c:211:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
      fread((*aes_buf)->data, 1, len, f);
      ^
    common.c:218:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
      fread((*cph_buf)->data, 1, len, f);
      ^
    gcc -o cpabe-setup setup.o common.o -O3 -Wall -lglib-2.0 -Wl,-rpath /usr/local/lib -lgmp -Wl,-rpath /usr/local/lib -lpbc -lbswabe -lcrypto -lcrypto 
    /usr/bin/ld: /usr/local/lib/libpbc.so: undefined reference to symbol '__gmpz_init'
    /usr/local/lib/libgmp.so: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    Makefile:34: recipe for target 'cpabe-setup' failed
    make: * [cpabe-setup] Error 1
    I hope you can help me, because I have literary no clue

Leave a Reply

Your email address will not be published.


*