Git Product home page Git Product logo

cpabe's Introduction

cpabe's People

Contributors

darkscout avatar junwei-wang avatar marcogrossi avatar shastick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpabe's Issues

Encrypting a file as a string removes the line breaks

Hello, I am trying to use your library to encrypt some csv files.

First I transform the file to a string. Maybe this approach is wrong.

  • I am doing MultipartFile file to get the file from a Rest request
  • content = new String(file.getBytes());
  • then encrypt and store
  • retrieve and decrypt,
  • return the file by content.getBytes()

The encryption and decryption work fine!!

However, during this process the csv seems to loose the line breaks and all comes as one line

Do you have any suggestions on how to tackle this problem ??

ps I have checked that just by uploading file, encoding to string, then decode it and return as a file maintains all line breaks, so I figure the encoding must play some role

java.lang.UnsatisfiedLinkError: Unable to load library 'jpbc-pbc': The specified module could not be found.

I'm using jpbc library but also it shows this error

java.lang.UnsatisfiedLinkError: Unable to load library 'jpbc-pbc': The specified module could not be found.

at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
at com.sun.jna.Library$Handler.(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:375)
at com.sun.jna.Native.loadLibrary(Native.java:360)
at it.unisa.dia.gas.plaf.jpbc.wrapper.jna.WrapperLibraryProvider.(WrapperLibraryProvider.java:14)
at it.unisa.dia.gas.plaf.jpbc.pbc.PairingFactory.isPBCAvailable(PairingFactory.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.(PairingFactory.java:59)
at it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.(PairingFactory.java:21)
at bswabe.Bswabe.setup(Bswabe.java:38)
at cpabe.Cpabe.setup(Cpabe.java:29)
at java_2_cpabe.DemoForCpabe.main(DemoForCpabe.java:421)

Decryption procedure

Dear Sir
while debugging your code in eclipse, my console shows the following messages, but after the decryption the decrypted file is not created. Could you please let me know the issue.
image

thank you

imports cannot be resolved.

below imports cannot be resolved:
Even i have jar file cpabe 2.0.0 and if i use cpabe 1.2.1 i get err.

  1. it.unisa.dia.gas.jpbc.CurveParameters and
  2. it.unisa.dia.gas.plaf.jpbc.pairing.DefaultCurveParameters

Anyone help me to solve this pbm.

来自小白的疑问!

你好,请问有没有Bswabe 类中的setup、keygen、delegate、enc等函数的详细文档,我是这方面的小白,最近在研究属性加密不知道公代码代表什么公式,请赐教!我的邮箱:[email protected]。 谢谢!

I have imported jpbc, but the following problem occurs

//start to setup
java.lang.UnsatisfiedLinkError: Unable to load library 'jpbc-pbc': ???????¨
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
at com.sun.jna.Library$Handler.(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:375)
at com.sun.jna.Native.loadLibrary(Native.java:360)
at it.unisa.dia.gas.plaf.jpbc.wrapper.jna.WrapperLibraryProvider.(WrapperLibraryProvider.java:14)
at it.unisa.dia.gas.plaf.jpbc.pbc.PairingFactory.isPBCAvailable(PairingFactory.java:18)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.(PairingFactory.java:49)
at it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.(PairingFactory.java:20)
at bswabe.Bswabe.setup(Bswabe.java:38)
at cpabe.Cpabe.setup(Cpabe.java:30)
at DemoForCpabe.main(DemoForCpabe.java:419)
Exception in thread "main" java.io.FileNotFoundException: file_dir\pub_key (系统找不到指定的路径。)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(Unknown Source)
at java.base/java.io.FileOutputStream.(Unknown Source)
at java.base/java.io.FileOutputStream.(Unknown Source)
at cpabe.Common.spitFile(Common.java:25)
at cpabe.Cpabe.setup(Cpabe.java:34)
at DemoForCpabe.main(DemoForCpabe.java:419)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.jna.Native (file:/F:/PROJECT/CPABE/jpbc/jars/jna-3.2.5.jar) to field java.lang.ClassLoader.nativeLibraries
WARNING: Please consider reporting this to the maintainers of com.sun.jna.Native
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 888

I installed the cpabe(The paper ''Ciphertext-Policy Attribute-Based Encryption " provide) in Linux. I want to use your decode function in Java. I use ther pub_key, private_key and encode.pdf.cpabe generated by the Linux cpabe function. When I use your decode function to decode the encode.pdf.cpabe:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 888
at bswabe.SerializeUtils.unserializeString(SerializeUtils.java:61)
at bswabe.SerializeUtils.unserializeBswabePub(SerializeUtils.java:87)
at cpabe.Cpabe.dec(Cpabe.java:109)
at DemoForCpabe.main(DemoForCpabe.java:434)
Could you please tell me what cause this? I tried, but I couldn't find a solution.

Encrypted File

Sir ,
I wanted to know if there is a way to read the encrypted file. Sorry for the inconvenience ,but I am still at the beginner level in coding and i have to submit a project related to this topic.It woulb be very helpful if you provide me some guidance.
Thank you

Getting Error

I am Getting

java.lang.UnsatisfiedLinkError: Unable to load library 'jpbc-pbc': The specified module could not be found.

at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:237)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:375)
at com.sun.jna.Native.loadLibrary(Native.java:360)
at it.unisa.dia.gas.plaf.jpbc.wrapper.jna.WrapperLibraryProvider.<clinit>(WrapperLibraryProvider.java:14)
at it.unisa.dia.gas.plaf.jpbc.pbc.PairingFactory.isPBCAvailable(PairingFactory.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.<init>(PairingFactory.java:49)
at it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.<clinit>(PairingFactory.java:20)
at ALGOS.setup(ALGOS.java:43)
at AA.setup(AA.java:25)
at ABE_ALGO.main(ABE_ALGO.java:34)

I have imported all jpbc-pbc jar files ...

file not find

The pub_key file、the master_key file and the prv_key file are not found .Could you tell me how to generate it or provide a test file?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.