GithubHelp home page GithubHelp logo

abe's People

Contributors

alexkorpas avatar codymlewis avatar sagrawal87 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

abe's Issues

encrypte file

If i want to encrypte some of my file,how can i modify the code?

windows

How to install Charm_Crypto on Windows

Pairing.Error: unsupported right operand types: int, bytes, str

Hi, I meet an error when I run python main.py like this. My environment is Python 2.7.12 , Charm 0.42 and Ubuntu (16.04)

Traceback (most recent call last):
  File "main.py", line 42, in <module>
    main()
  File "main.py", line 29, in main
    ctxt = cpabe.encrypt(pk, msg, policy_str)
  File "/home/rocky/Desktop/ABE-master/ac17.py", line 203, in encrypt
    prod1 *= (hash_table[j][l][t] ** row[j])
pairing.Error: unsupported right operand types: int, bytes, str

Does author meet this error before? I am wondering whether it it caused by the Charm version?

Error: Could not find suitable distribution for Requirement.parse('pyparsing>=1.5.5')

Hi, I want to test the ac17.py scheme and need to install the Charm at first. While I meet this error when installing the charm cryptography library. My platform is ubuntu (16.04) and the python version is 2.7.12. The following error appears when executing make install.

No local packages or download links found for pyparsing>=1.5.5
error: Could not find suitable distribution for
Requirement.parse('pyparsing>=1.5.5')
Makefile:97: recipe for target 'install' failed

This is the output info when executing make install command.

removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing Charm_Crypto-0.42-py2.7-linux-x86_64.egg
removing '/usr/local/lib/python2.7/dist-packages/Charm_Crypto-0.42-py2.7-linux-x86_64.egg' (and everything under it)
creating /usr/local/lib/python2.7/dist-packages/Charm_Crypto-0.42-py2.7-linux-x86_64.egg
Extracting Charm_Crypto-0.42-py2.7-linux-x86_64.egg to /usr/local/lib/python2.7/dist-packages
Charm-Crypto 0.42 is already the active version in easy-install.pth

Installed /usr/local/lib/python2.7/dist-packages/Charm_Crypto-0.42-py2.7-linux-x86_64.egg
Processing dependencies for Charm-Crypto==0.42
Searching for pyparsing>=1.5.5
Reading http://pypi.python.org/simple/pyparsing/
Couldn't find index page for 'pyparsing' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pyparsing>=1.5.5
error: Could not find suitable distribution for Requirement.parse('pyparsing>=1.5.5')
Makefile:97: recipe for target 'install' failed

I have tried to fix this error and google some solution, someone said I should install pip and python setuptools and then install an old version of pyparsing (1.5.7). But this will appear another error also about pyparsing. I guess the key issue is pyparsing, and these are the files under the folder python2.7/dist-packages as following.

root@rocky-VirtualBox:/usr/local/lib/python2.7/dist-packages# ls
Charm_Crypto-0.42-py2.7-linux-x86_64.egg  pyparsing-1.5.7.dist-info
distribute-0.6.24-py2.7.egg               pyparsing.py
easy-install.pth                          pyparsing.pyc
easy_install.py                           setuptools
easy_install.pyc                          setuptools-0.6c11-py2.7.egg-info
pip                                       setuptools-38.4.0.dist-info
pip-9.0.1.dist-info                       setuptools.pth
pkg_resources

Type casting EC points from str to <class pairing.Element>

I was implementing a sample code and face the following problem.
P = P1 ** k gave error like left hand operand is not suitable, the issue is I have red the point P1 from a file. When I checked type(P1) it is showing str where as the points like P2=group.rand(G1) shows when used with type.

so how can I use the msg defined by my own,
msg = pairing_group.random(GT)
how can I convert bytes or str to pairing.Element?

charm installation error

While running sudo make in Charm-crypto-0.43 directory getting error
sudo make
Setup build/staging directories
set -x
set +x
Building the Charm Framework
/usr/bin/python3 setup.py build
Extracting in /tmp/tmp82cjmzdb
Traceback (most recent call last):
File "/home/reetu/Charm-Crypto-0.43/distribute_setup.py", line 150, in use_setuptools
raise ImportError
ImportError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 2, in
use_setuptools() #bootstrap installs Distribute if not installed
File "/home/reetu/Charm-Crypto-0.43/distribute_setup.py", line 152, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "/home/reetu/Charm-Crypto-0.43/distribute_setup.py", line 132, in _do_download
_build_egg(egg, tarball, to_dir)
File "/home/reetu/Charm-Crypto-0.43/distribute_setup.py", line 105, in _build_egg
_extractall(tar)
File "/home/reetu/Charm-Crypto-0.43/distribute_setup.py", line 500, in _extractall
self.chown(tarinfo, dirpath)
TypeError: chown() missing 1 required positional argument: 'numeric_owner'
Makefile:27: recipe for target 'all' failed
make: *** [all] Error 1

No result output

I ran through your code but there is no result output, how can I get the result for your paper?

NameError: name 'downcaseTokens' is not defined

Hi, I am trying to run your code on Ubuntu 18.04 with python3.6 and charm-crypto 0,50.

So far the compiling process is okay. All implementation of "make" and "make install" are all right. But the error "NameError: name 'downcaseTokens' is not defined" occurs when I run the code.

As far as I know, your code depends on python2.7 enviroment. Is there any conflicts between the code and python3.X? How should I fix this problem?

Conditional Attributes and Policies

I want to create attributes and policies which are conditional in nature.

For instance:
Policy : AGE > 25
Attribute : AGE = 22

Decryption would not be possible in this case

How do I specify such attributes and policies?

ValueError: invalid literal for int() with base 10: 'FOUR'

Hi, Shashank, I meet this error when I test waters11 scheme as follows, do u meet this kind of error before?
root@ubuntu:/home/osborn/FAME# python3 main.py
setup Time: 495.1

keygen Time: 62.5

Traceback (most recent call last):
File "main.py", line 84, in <module>
main()
File "main.py", line 58, in main
ctxt = cpabe.encrypt(pk, msg, policy_str)
File "/home/osborn/FAME/waters11.py", line 110, in encrypt
c_attr = (pk['g1_a'] ** sum) / (pk['h'][int(attr_stripped)] ** r_attr)
ValueError: invalid literal for int() with base 10: 'FOUR'

The attribute list and policy which I set in main.py are as follows

attr_list = ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE', 'TEN']
policy_str = '(ONE and THREE and (TWO OR FOUR) and FIVE and SIX and SEVEN and EIGHT and NINE and TEN)'

So the error should be related to the ciphertext generation during encryption. But I don't understand what's the function of the attr_stripped = self.util.strip_index(attr) , I test the output of attr_stripped should be a string, but it will error when converting to int, can you give me some reminding about this?

msp.py 'unicode' object has no attribute Error

$ python main.py
Traceback (most recent call last):
  File "main.py", line 44, in <module>
    main()
  File "main.py", line 31, in main
    ctxt = cpabe.encrypt(pk, msg, policy_str)
  File "/Users/apple/Competion/Cryptology2018/ABE/ac17.py", line 152, in encrypt
    policy = self.util.createPolicy(policy_str)
  File "/Users/apple/Competion/Cryptology2018/ABE/msp.py", line 32, in createPolicy
    policy_obj = parser.parse(policy_string)
  File "/Library/Python/2.7/site-packages/charm/toolbox/policytree.py", line 83, in parse
    self.finalPol.parseString(string)
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1622, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3717, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3378, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3717, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3378, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3395, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3717, in parseImpl
    return self.expr._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3378, in parseImpl
    loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1379, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 3530, in parseImpl
    ret = e._parse( instring, loc, doActions )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1405, in _parseNoCache
    tokens = fn( instring, tokensStart, retTokens )
  File "/Library/Python/2.7/site-packages/pyparsing.py", line 1049, in wrapper
    ret = func(*args[limit[0]:])
  File "/Library/Python/2.7/site-packages/charm/toolbox/policytree.py", line 15, in createAttribute
    return BinNode(toks[0]) # create
  File "/Library/Python/2.7/site-packages/charm/toolbox/node.py", line 26, in __init__
    elif(value >= OpType.OR and value < OpType.NONE):
  File "/Library/Python/2.7/site-packages/charm/toolbox/enum.py", line 29, in __le__
    return (self.__value <= other.__value)
AttributeError: 'unicode' object has no attribute '_EnumValue__value'

I follow your advice to install Charm in my MacOs, python is the system's default python 2.7.10 ,But meet this Error,Please Help......

NameError: name 'ZR' is not defined

In the pairinggroup.py, it has the code " from charm.core.math.pairing import pairing,pc_element,ZR,G1,G2,GT,init,pair,hashPair,H,random,serialize,deserialize,ismember,order ". However I can't find the ZR,G1...... How can I solve this problem? Have I miss some files?

BLS12-381 curve

Do you know how to adopt the BLS12-381 curve within charm-crypto (i.e. generating it with PBC)?

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.