Comments (11)
Hi, we need more information, which are the arguments not provided? It's not clear in your message.
from rabe.
Hi, PekeDevil.
In your rabe-console Readme has this:
"Setup a AC17 KP-ABE scheme
$ rabe --s AC17CP setup
This generates msk.key and pk.key
Generate a new key with attributes "A" and "B"
$ rabe --s AC17CP keygen --a 'A B'"
Ok. But i want to encrypt a file. I try to make this with this command:
rabe --s AC17CP encrypt pk.key 'B' teste.doc
But it doesn't work. It finishes in a error.
What is the correct command to encrypt a file with rabe-console?
And what's correct command for decrypt this files later?
from rabe.
The rabe-console help doesn't help me in this question.
from rabe.
What I'm saying is that you should paste the error message. That being said, I'm not the author of Rabe, but I'm pretty sure that to encrypt something using CP-ABE you need to provide the global parameters (created during setup, I guess that that's the pk.key
) and the access policy. "B" may not be recognized as an access policy, and instead, the library may be confusing it with an attribute.
from rabe.
I understand. The error is this:
**```
error: The following required arguments were not provided:
USAGE:
rabe encrypt [ARGS]
And other example, 2:
rabe encrypt pk.key "B" ./teste.doc
error: The following required arguments were not provided:
USAGE:
rabe --s encrypt [ARGS]
I am trying to run the command how to you explain me. Thanks!
from rabe.
New errors:
$ rabe --s AC17CP encrypt pk.key 1 of 'A B' teste.doc
error: The following required arguments were not provided:
<f>
USAGE:
rabe encrypt <f> [ARGS]
$ rabe --s AC17CP encrypt teste.doc pk.key 'A>2'
error: The following required arguments were not provided:
<f>
USAGE:
rabe encrypt <f> [ARGS]
from rabe.
There is so much to say here, but let's start with A>2
or A B
not being access policies. I understand you must be quite frustrated by now, but revise twice your commands because you're starting to have some typing mistakes.
rabe encrypt pk.key "B" ./teste.doc
you did not provide the --s
flag
rabe --s AC17CP encrypt pk.key 1 of 'A B' teste.doc
: you have a 1 there that should not exist.
rabe --s AC17CP encrypt teste.doc pk.key A>2
you have not provided the public key. Also, A>2
may not be considered a valid access policy in many schemes and libraries.
Again, no idea how the rabe-console works, but using access policies accepted by the scheme you have chosen can be a good starting point e.g., r#""A" and "B""#
as shown in the documentation or something along the lines of A and B
at the very least.
According to the command line code for encryption, you need GP_FILE, PK_FILE, ATTRIBUTES, POLICY, FILE
. The parameters depend on KP-ABE or CP-ABE.
You have chosen a CP-ABE scheme, so for encryption you need the public parameters, a policy, and a file.
Try this:
rabe --s AC17CP setup
creates msk.key
and pk.key
rabe --s AC17CP keygen --a 'A B'
this creates a private key that contains A and B as attributes
rabe --s AC17CP encrypt pk.key 'A and B' ./teste.doc
this should encrypt test.doc according to the defined access policy.
Check if this works, and what file encrypt returns, and then decryption should be straightforward.
from rabe.
I understood.
But still no work the encryption file with rabe:
from rabe.
Hello, after rechecking the code, the error asks you to input the file after "encrypt". However, it has not worked when I tried this on my machine. It may be a problem with the extension, but I cannot say. Using the flag --help
does not provide much more information.
I have used this library by running a .rs file, which seems to be the best option. Sorry for not being of help!
from rabe.
You got where i got, PekeDevil.
But i am grateful for your help.
Thank you!
from rabe.
- Start with compiling the console app (in the main folder):
$ cargo build --color=always -p rabe-console --release - create a new scheme with pk/msk (in the main folder):
$ ./target/release/rabe --s AC17CP setup - create a keypair with attributes A and B
$ ./target/release/rabe --s AC17CP keygen --a "A B" - encrypt a file 'msk.key' with a policy A or B
./target/release/rabe --s AC17CP encrypt msk.key '"A" or "B"'
I know its kind of confusing that sometimes --, other times - and in some cases there is no - at all. Thats all based on clap. Maybe an updated implementation with latest clap would help. This will be done in one of the next updates.
from rabe.
Related Issues (14)
- Release it on crates.io HOT 2
- CLI utilities do not work HOT 1
- Library fails to process policies with more than 60 attributes. HOT 8
- cffi HOT 1
- in order to create example, how to calculate time based on number of Attributes? HOT 1
- YCT14 KP-ABE scheme is broken HOT 1
- About the AES dependency HOT 2
- Change some function signature HOT 2
- How can I use this project in Python? HOT 4
- HumanPolicy failed HOT 2
- Duplicate attributes not supported in BSW scheme HOT 2
- Getting "The following required arguments were not provided" when compiling rabe-console HOT 4
- code is inactive due to #[cfg] directives: feature = "borsh" is disabled HOT 1
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 rabe.