Comments (2)
This needed to perform,
- Encrypton at one end
- Decryption at another end (in a separate code base or exe)
from openabe.
I'm replying a bit late, but I'll leave the answer in case it's still useful. It's a bit long because I think there are certain concepts that I think are important to clarify.
In order to do what you are asking for (one endpoint encrypts and another decrypts). Ideally, you need three endpoints:
- The key generator/initializer.
- The encryptor
- The decryptor
In addition to that you have to ensure minimum communication between the following endpoints:
- The key generator and the decryptor.
- The encryptor and the decryptor.
Having said that, the step-by-step process is as follows:
- The key generator initialises the system, and generates the MPK and the MSK.
- The key generator must deliver the MPK to ALL endpoints that want to participate in the communication. To make it more efficient, you can also leave the MPK in a repository to which the endpoints have access.
- The key generator generates a secret key (SK) for each endpoint that wants to act as decryptor, and delivers it to them privately through a secure channel.
With these 3 steps the system would be "initialised", i.e. in theory all endpoints have the necessary parameters to participate in the encrypted communication. There is no need to regenerate the MSK and MPK.
Next, to fulfill the encryption and decryption on different endpoints:
- The encryptor uses the MPK as well as the desired access policy to encrypt the information.
- The encryptor sends the encrypted information to the decryptor.
- The decryptor uses the same MPK as the encryptor, together with the SK sent by the key generator to decrypt the information.
Having established this, one important thing I want to make clear is that in order for all participants in the encrypted communication to be able to "talk" to each other, they must share the same MPK. That is, all SKs must be generated with the same MPK and MSK, and all messages must be encrypted and decrypted with the same MPK.
Some of your other questions:
"This does not work. Because of random key generation, mpk and msk are different for every run".
This is because you only have to initialize them once.
"Is there any hack for this to hard code previously generated key in the code. So that for every run keys will not change."
Hardcoding secret keys is a serious security violation, instead the MSK must be stored securely (e.g. in a TPM). The MPK is public and you can (and indeed should) share it among all members of the communication.
"Please suggest the code point, where I can hard code this."
Please consider my answer above, but to manage the MPK and MSK OpenABE offers the following functions:
cpabe.importPublicParams(mpk)
cpabe.importSecretParams(msk)
from openabe.
Related Issues (20)
- Ciphertext size HOT 1
- Compile command may not work in some environment
- Error When install openabe HOT 11
- OpenABE on ARMv6 HOT 2
- Error while install openabe HOT 5
- OpenSSL Version in the installation script HOT 1
- Error on Windows while installing the library
- Make Command Return Error RELIC Ubuntu 20.04 LTS HOT 1
- ./oabe_enc error: could not open file
- Mac OS make test test_libopenabe
- Mac make HOT 1
- Huge Cipher Text Size on CP-ABE HOT 1
- Build issue on Raspberry Pi ZeroW
- ubuntu20.04 make test HOT 3
- The Specific Implementation of kengen Function
- make / gcc compilation errors on zobject.cpp HOT 1
- I've issue with "glob" is not exported by the File::Glob module
- zsh: illegal hardware instruction cpabe-setup
- The memory leaks in using CP-ABE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openabe.