sagrawal87 / ABE

Attribute-based Encryption
MIT License
181 stars 67 forks source link

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

Closed RockyZhangHKU closed 3 years ago

RockyZhangHKU commented 6 years ago

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?

scmanjarrez commented 4 years ago

Hi @RockyZhangHKU , did you manage to resolve the issue? Same problem occur in cgw15.py

NorwegianForest commented 4 years ago

Hi @scmanjarrez , maybe you can try like attr_list = ['1', '2', '3']

MilesChan001 commented 3 years ago

@RockyZhangHKU 您好,我测试waters11 方案也遇到了同样的问题,后来这个问题您解决了吗?

RockyZhangHKU commented 3 years ago

@RockyZhangHKU 您好,我测试waters11 方案也遇到了同样的问题,后来这个问题您解决了吗? 没有解决,我后来毕业后就不研究ABE这个方向了,祝你好运~