{"id":21905913,"url":"https://github.com/cosmian/cloudproof_java","last_synced_at":"2025-03-22T07:19:34.603Z","repository":{"id":38971411,"uuid":"446070612","full_name":"Cosmian/cloudproof_java","owner":"Cosmian","description":"The Java API library to Cosmian Cloudproof Encryption","archived":false,"fork":false,"pushed_at":"2024-03-18T15:40:25.000Z","size":46778,"stargazers_count":2,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T07:30:15.232Z","etag":null,"topics":["cloud","cloudproof","cryptography","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cosmian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-09T11:36:48.000Z","updated_at":"2023-09-06T20:05:16.000Z","dependencies_parsed_at":"2024-03-01T15:30:03.483Z","dependency_job_id":"dec3d7ca-8769-4156-9507-2aa0f6d2c3a0","html_url":"https://github.com/Cosmian/cloudproof_java","commit_stats":null,"previous_names":["cosmian/cosmian_java_lib"],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmian%2Fcloudproof_java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmian%2Fcloudproof_java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmian%2Fcloudproof_java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cosmian%2Fcloudproof_java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cosmian","download_url":"https://codeload.github.com/Cosmian/cloudproof_java/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244919786,"owners_count":20531872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","cloudproof","cryptography","java"],"created_at":"2024-11-28T16:39:14.701Z","updated_at":"2025-03-22T07:19:34.578Z","avatar_url":"https://github.com/Cosmian.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudproof Java Library\n\n![workflow](https://github.com/Cosmian/cloudproof_java/actions/workflows/ci.yml/badge.svg)\n\nThe Cloudproof Java library provides a Java-friendly API to [Cosmian's Cloudproof Encryption](https://docs.cosmian.com/).\n\nCloudproof Encryption secures data repositories and applications in the cloud with advanced application-level encryption and encrypted search.\n\n\u003c!-- toc --\u003e\n\n- [Licensing](#licensing)\n- [Cryptographic primitives](#cryptographic-primitives)\n- [Getting started](#getting-started)\n- [Benchmarks](#benchmarks)\n- [Versions Correspondence](#versions-correspondence)\n- [Using in Java projects](#using-in-java-projects)\n  - [Download required native libraries](#download-required-native-libraries)\n  - [Building the native libraries on your own](#building-the-native-libraries-on-your-own)\n\n\u003c!-- tocstop --\u003e\n\n## Licensing\n\nThe library is available under a dual licensing scheme Affero GPL/v3 and commercial. See [LICENSE.md](LICENSE.md) for details.\n\n## Cryptographic primitives\n\nThe library is based on:\n\n- [CoverCrypt](https://github.com/Cosmian/cover_crypt) algorithm which allows\n  creating ciphertexts for a set of attributes and issuing user keys with access\n  policies over these attributes. `CoverCrypt` offers Post-Quantum resistance.\n\n- [Findex](https://github.com/Cosmian/findex) which is a cryptographic protocol designed to securely make search queries on\n  an untrusted cloud server. Thanks to its encrypted indexes, large databases can\n  securely be outsourced without compromising usability.\n\n## Getting started\n\nPlease [check the online documentation](https://docs.cosmian.com/) for details on using the CloudProof APIs\n\nIn addition, please have a look at the following tests for implementation examples:\n\n- [TestCoverCrypt](./src/test/java/com/cosmian/TestKmsCoverCrypt.java) for using the CoverCrypt scheme with Cosmian KMS\n- [TestFfiCoverCrypt](./src/test/java/com/cosmian/TestNativeCoverCrypt.java) for using the CoverCrypt scheme with the local native library\n- [TestKmip](./src/test/java/com/cosmian/TestKmip.java) for using the KMIP 2.1 interface with the Cosmian KMS\n- [TestSqliteFindex](./src/test/java/com/cosmian/findex/TestSqlite.java) for using the Encrypted Search Findex scheme using Sqlite (or other SQL DBs) as a backend\n- [TestRedisFindex](./src/test/java/com/cosmian/findex/TestRedis.java) for using the Encrypted Search Findex scheme using Redis as a backend\n\n## Benchmarks\n\nThe following benchmarks are obtained using an Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz.\n\n```c\n-----------------------------------------------------\n Benches CoverCrypt Encryption/Decryption With Cache\n-----------------------------------------------------\n\nClassic encryption\n==================\n\nNumber of partitions: 1: Encrypted Header size: 131. Encryption average time: 262971ns (262µs). Decryption average time: 221256ns (221µs)\nNumber of partitions: 2: Encrypted Header size: 164. Encryption average time: 347328ns (347µs). Decryption average time: 257798ns (257µs)\nNumber of partitions: 3: Encrypted Header size: 197. Encryption average time: 431084ns (431µs). Decryption average time: 411985ns (411µs)\nNumber of partitions: 4: Encrypted Header size: 230. Encryption average time: 513750ns (513µs). Decryption average time: 473802ns (473µs)\nNumber of partitions: 5: Encrypted Header size: 263. Encryption average time: 599409ns (599µs). Decryption average time: 536418ns (536µs)\n\nHybridized encryption\n======================\n\nNumber of partitions: 1: Encrypted Header size: 1187. Encryption average time: 320732ns (320µs). Decryption average time: 232779ns (232µs)\nNumber of partitions: 2: Encrypted Header size: 2276. Encryption average time: 467049ns (467µs). Decryption average time: 273931ns (273µs)\nNumber of partitions: 3: Encrypted Header size: 3365. Encryption average time: 611346ns (611µs). Decryption average time: 315654ns (315µs)\nNumber of partitions: 4: Encrypted Header size: 4454. Encryption average time: 754446ns (754µs). Decryption average time: 358415ns (358µs)\nNumber of partitions: 5: Encrypted Header size: 5543. Encryption average time: 900514ns (900µs). Decryption average time: 400720ns (400µs)\n```\n\nThe version without using the cache adds the deserialization time for the\npolicy and public key during the encryption process, and the user decryption\nkey during the decryption process. This time may vary depending on the size of\nthese objects.\n\nIn the case of the above benchmark, deserializing the policy and the public key\ntakes about 200µs for sizes of 1037 and 18935 bytes respectively (the public\nkey is half hybridized).\n\n## Versions Correspondence\n\nThis library uses [cloudproof_rust](https://github.com/Cosmian/cloudproof_rust) for both CoverCrypt and Findex FFI interface.\n\nThis table shows the compatible versions of the various components\n\nFrom the version 5.0.0, `cloudproof_java` depends on [cloudproof_rust](https://github.com/Cosmian/cloudproof_rust) which wraps the interfaces of `CoverCrypt` and `Findex`.\n\n| This lib | KMS Server | Cloudproof Rust lib |\n| -------- | ---------- | ------------------- |\n| 5.0.0    | 4.3.3      | 1.0.0               |\n| 6.0.0    | 4.3.3      | 2.0.1               |\n| 7.0.0    | 4.10.0     | 2.4.0               |\n| 7.1.0    | 4.11.0     | 2.4.0               |\n| 7.2.0    | 4.11.3     | 2.4.0               |\n| 8.0.\\*   | 4.13.3     | 3.0.0               |\n\n## Using in Java projects\n\nThis library is open-source software and is available on Maven Central.\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.cosmian\u003c/groupId\u003e\n    \u003cartifactId\u003ecloudproof_java\u003c/artifactId\u003e\n    \u003cversion\u003e6.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Download required native libraries\n\nThe Cloudproof Java lib uses JNA to access functions of the following native cryptographic libraries:\n\n- `CoverCrypt`\n- `Findex`\n\nThose libraries must be found either in the classpath or in subfolders of `src/main/resources/`\n\n- src/main/resources/\n  - `linux-x86-64` for Linux 64bit architecture\n  - `darwin-x86-64` for MacOS Intel\n  - `win32-x86-64` for windows\n\nFor tests, it is possible to override these libraries by placing them in the equivalent sub-folders of `src/test/resources`\n\nTo download them, please run the following script that will fetch the releases in the public URL [package.cosmian.com](https://package.cosmian.com):\n\n```bash\npython3 scripts/get_native_libraries.py\n```\n\nOtherwise, to build those libraries manually, please check the CoverCrypt and Findex projects on Github: their `build` directory contains instructions on how to build the native libraries for your system.\n\n### Building the native libraries on your own\n\nFor `CoverCrypt`:\n\n```bash\ngit clone https://github.com/Cosmian/cover_crypt.git\ncargo build --release --features ffi\n```\n\nFor `Findex`:\n\n```bash\ngit clone https://github.com/Cosmian/findex.git\ncargo build --release --features ffi\n```\n\nAnd copy the new binaries from `target/release/\u003c.dylib,.so,.dll\u003e` to `cloudproof_java` FFI directory: check the right platform/architecture directory in [Download required native libraries](#download-required-native-libraries).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmian%2Fcloudproof_java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosmian%2Fcloudproof_java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosmian%2Fcloudproof_java/lists"}