Client server implementation of CP-ABE

63 views
Skip to first unread message

Sangeetha Raghu

unread,
Dec 8, 2017, 5:48:32 AM12/8/17
to Charm-Crypto Help
Hi all,
I am trying to implement an client server architecture for CP-ABE but i am unable to decrypt the text correctly as the order of elements change when i send it through socket. If anyone can help me stating how to send the data and make it work...
Thanks for ur help...

Marcos Portnoi

unread,
Dec 8, 2017, 5:58:44 PM12/8/17
to Charm-Crypto Help
How are you implementing this?

In general, if you encrypt your message first with CP-ABE (hybrid), then serialize it, send through socket, receive, deserialize, there should not be an issue decrypting. The deserialization should give you a dictionary with the same structure you had before serializing, with perhaps a different order, but still recognizable by the ABE (hybrid) decryption routine.

MP

Sangeetha Raghu

unread,
Dec 11, 2017, 8:03:42 AM12/11/17
to charm-...@googlegroups.com
No i am not getting it. I am using objecttobyte and bytetoobject method that is present in charm crypto but it is also not decrypting properly.If you need i can share my code. I am struggling for it for a long time please help me out to solve this issue

--
You received this message because you are subscribed to a topic in the Google Groups "Charm-Crypto Help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/charm-crypto/67jxm97yqk4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to charm-crypto+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marcos Portnoi

unread,
Dec 11, 2017, 12:27:54 PM12/11/17
to Charm-Crypto Help
Yes, if you share the code I will take a peek to see whether I can help.
To unsubscribe from this group and all its topics, send an email to charm-crypto...@googlegroups.com.

Sangeetha Raghu

unread,
Dec 11, 2017, 11:42:03 PM12/11/17
to charm-...@googlegroups.com
Hi,
I am here attaching my server and keygen program here. Keygen is used to generate different keys and send it to server and server program is used to do encryption and decryption using the key given by the keygen program. Here i dont get the decryption properly.
Please help me to fix the same. Thanks for ur help
Regards,
Sangeetha Raghu

To unsubscribe from this group and all its topics, send an email to charm-crypto+unsubscribe@googlegroups.com.
keygen.py
server.py
HybridABEnc.py

Sangeetha Raghu

unread,
Dec 12, 2017, 1:11:39 AM12/12/17
to charm-...@googlegroups.com
Thanks alot for your help i got the output and i did silly mistake in defining the access policy. I left gap and dint note it. Sorry to trouble you.

Marcos Portnoi

unread,
Dec 12, 2017, 10:18:20 AM12/12/17
to Charm-Crypto Help
Wait, did you get it working?

I saw something in your server.py code that seemed weird. These lines:

s.connect((host,port))
mpk=s.recv(port)
mpk=dict(mpk)
print type(mpk)
mpk=bytesToObject(mpk,group)
print "*********"
print mpk

Here, you receive data from the socket and make a dictionary of it, *before* converting the data from bytes to object. The operation should be bytesToObject first, then dict (if necessary). Note that, in keygen.py, you build a dictionary first, then convert (objectToBytes), then send to socket.


MP

Sangeetha Raghu

unread,
Dec 12, 2017, 11:47:29 PM12/12/17
to charm-...@googlegroups.com
Hi,
ya whatever you say is correct. It was not working later i did few changes and it started working i have attached the working code here. Thanks

To unsubscribe from this group and all its topics, send an email to charm-crypto+unsubscribe@googlegroups.com.
keygen.py
server.py
Reply all
Reply to author
Forward
0 new messages