sagrawal87 / abe Goto Github PK
View Code? Open in Web Editor NEWAttribute-based Encryption
License: MIT License
Attribute-based Encryption
License: MIT License
If i want to encrypte some of my file,how can i modify the code?
How to install Charm_Crypto on Windows
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?
Hi!
@alexkorpas @sagrawal87 @codymlewis
I could use a bit of help on another implementation I'm working on and wanted to know if you'd be interested in collaborating on that. Not really an issue, but no other way to contact you otherwise to gauge interest. I'm trying to implement the following: https://eprint.iacr.org/2019/1325.pdf
in JS and/or Python. Any help you're able to render is much appreciated!
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
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?
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
Hi,
I'm getting this error when I tied to run main.py
Traceback (most recent call last): File "main.py", line 6, in <module> from charm.toolbox.pairinggroup import PairingGroup, GT
I'm running Charm 0.43 and Python 2.7.10 on Mac OS X
I ran through your code but there is no result output, how can I get the result for your paper?
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?
@sagrawal87 @alexkorpas @codymlewis please guide me I'm an absolute beginner
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?
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?
$ 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......
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?
Do you know how to adopt the BLS12-381 curve within charm-crypto (i.e. generating it with PBC)?
when I compile using python main.py
, the error occurred libpbc.so.1: cannot open shared object file: No such file or directory.
but I have installed charm successfully
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.