{"id":33152968,"url":"https://github.com/IronCoreLabs/recrypt","last_synced_at":"2025-11-15T22:00:40.184Z","repository":{"id":32433429,"uuid":"132779657","full_name":"IronCoreLabs/recrypt","owner":"IronCoreLabs","description":"Transform encryption library for Scala","archived":false,"fork":false,"pushed_at":"2025-11-10T20:21:40.000Z","size":619,"stargazers_count":35,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-11-10T22:14:03.987Z","etag":null,"topics":["cryptography","proxy-re-encryption","scala"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IronCoreLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":"COPYRIGHT","agents":null,"dco":null,"cla":null}},"created_at":"2018-05-09T15:48:28.000Z","updated_at":"2025-11-10T20:21:46.000Z","dependencies_parsed_at":"2024-01-19T20:40:22.939Z","dependency_job_id":"48fc74d5-733c-4141-857d-8d80f0bc1e51","html_url":"https://github.com/IronCoreLabs/recrypt","commit_stats":{"total_commits":242,"total_committers":10,"mean_commits":24.2,"dds":"0.23966942148760328","last_synced_commit":"d5c0d2315b2b626e7ddb9a7bc5597dd58ef6631b"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/IronCoreLabs/recrypt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCoreLabs%2Frecrypt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCoreLabs%2Frecrypt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCoreLabs%2Frecrypt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCoreLabs%2Frecrypt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IronCoreLabs","download_url":"https://codeload.github.com/IronCoreLabs/recrypt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IronCoreLabs%2Frecrypt/sbom","scorecard":{"id":67867,"data":{"date":"2025-08-11","repo":{"name":"github.com/IronCoreLabs/recrypt","commit":"d53665102170487df9c99ca062480c06b7cab94e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"14 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":9,"reason":"Found 28/30 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/IronCoreLabs/recrypt/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/IronCoreLabs/recrypt/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/IronCoreLabs/recrypt/ci.yaml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU Affero General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T03:01:29.635Z","repository_id":32433429,"created_at":"2025-08-15T03:01:29.635Z","updated_at":"2025-08-15T03:01:29.635Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284628148,"owners_count":27037491,"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","status":"online","status_checked_at":"2025-11-15T02:00:06.050Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cryptography","proxy-re-encryption","scala"],"created_at":"2025-11-15T19:00:46.110Z","updated_at":"2025-11-15T22:00:40.176Z","avatar_url":"https://github.com/IronCoreLabs.png","language":"Scala","funding_links":[],"categories":["Frameworks and Libs"],"sub_categories":["Scala"],"readme":"# Recrypt\n\n[![CI](https://github.com/IronCoreLabs/recrypt/actions/workflows/ci.yaml/badge.svg)](https://github.com/IronCoreLabs/recrypt/actions/workflows/ci.yaml)\n[![codecov.io](https://codecov.io/github/IronCoreLabs/recrypt/coverage.svg?branch=main)](https://codecov.io/github/IronCoreLabs/recrypt?branch=main)\n[![scaladoc](https://javadoc-badge.appspot.com/com.ironcorelabs/recrypt-core_2.12.svg?label=scaladoc)](https://javadoc-badge.appspot.com/com.ironcorelabs/recrypt-core_2.12)\n\nThis is a library that implements a set of cryptographic primitives that are needed for a _multi-hop proxy re-encryption_ scheme.\n\nThe library is implemented in Scala, and the build produces a `.jar` you can use with Java applications.\n\n# State of Development\n\nThis library is in the process of being replaced by a version implemented in Rust. The Rust library will have a binding to Java that can be used in environments where the library produced by this recrypt repository would have been used. The Rust library is available at [recrypt-rs](https://github.com/IronCoreLabs/recrypt-rs). All new improvements and performance enhancement efforts are focused on the Rust implementation, and there is a related project, [recrypt-wasm-binding](https://github.com/IronCoreLabs/recrypt-wasm-binding), that is a WebAssembly binding that allows the Rust recrypt library to be used in a browser.\n\n# Proxy Re-Encryption\n\nA proxy re-encryption (PRE) scheme is a public-key encryption scheme, meaning that each participant has a pair of related keys, one public and one private. If Alice wants to encrypt a message so that only Bob can read it, she obtains Bob's public key and uses the public key encryption algorithm to secure the message. When Bob receives the encrypted message, he uses his private key to decrypt it and recover the original message.\n\nPRE allows someone (the _delegator_) to delegate the ability to decrypt her messages to another person (the _delegatee_). In a standard public-key cryptosystem, the delegator would just need to share her private key with the delegatee. This allows the delegatee to access the encrypted messages, but when the delegator wants to revoke the access, she cannot be absolutely sure the delegatee will discard his copy of the private key. With proxy re-encryption, the delegator computes a _re-encryption key_ (or _transform key_) that will allow messages encrypted to her public key to be transformed so they are encrypted to the delegatee's public key. Computing this transform key requires the delegator's private key and the delegatee's public key; once it is computed, the key is stored on a _semi-trusted proxy_.\n\nThe proxy receives messages intended for the delegator, applies the transform algorithm using the transform key, and delivers the transformed message to the delegatee. **The proxy does not need to be trusted, because possession of the transform key does not allow the proxy to recover any information about either the delegator's or the delegatee's private keys.** The delegatee cannot collaborate with proxy to recover any information about the delegator's private key.\n\nWhen the delegator no longer wants to delegate access, she just requests that the proxy discard the transform key. She must trust the proxy to perform this action.\n\n### PRE Scheme Properties\n\nThere are a number of ways to categorize PRE schemes; some of the most important are the following:\n\n- _Directionality_ describes whether delegate from A to B also allows transformation from B to A. Unidirectional schemes do not allow this.\n- _Interactivity_ describes whether both parties must be actively involved in order to generate the transform key. A non-interactive scheme only requires the public key of the delegatee.\n- _Transitivity_ describes whether a proxy can re-delegate encryption. That is, if the proxy holds a transform key from A to B and a transform key from B to C, can it generate a transform key from a to C? A non-transitive scheme does not allow this.\n- _Collusion safety_ describes whether it is possible for a delegatee to collude with the proxy that holds a transform key to that delegatee in order to recover the private key of the delegator. A collusion-safe scheme does not allow this.\n- _Multi-hop_ describes whether it is possible to allow a delegatee to also be a delegator. That is, does the scheme allow a ciphertext that has already been transformed from Alice to Bob to subsequently be transformed from Bob to Carol. In a multi-hop situation, the proxies would cahin the transformations, so any delegatee in the chain could decrypt any message that one of her delegators could decrypt.\n\nThe Recrypt library implements a PRE scheme that is unidirectional, non-interactive, non-transitive, collusion-safe, and multi-hop.\n\n## Cryptographic Primitives\n\nThe Recrypt library provides the following cryptographic primitives that are part of the proxy re-encryption scheme:\n\n- `generateKeyPair`: generate a public/private key pair for the caller. The private key is chosen randomly\n- `generateTransformKey`: given a delegator's private key and a delegatee's public key, generate the transform key\n- `encrypt`: given a message, the recipient's public key, and the sender's private and public signing key pair, encrypt the message using the PRE scheme and sign the encrypted message\n- `transform`: given an encrypted or re-encrypted message, the transform key from the last recipient to a new recipient, and the proxy's private and public signing key pair, transform the message so it can be decrypted by the new recipient's private key, then sign the reencrypted message.\n- `decrypt`: given an encrypted or re-encrypted message and the recipient's private key, decrypt the message then verify the signatures to confirm that the retrieved plaintext matches the plaintext that was originally encrypted.\n\n## Algorithms\n\nThe PRE algorithm implemented here was originally suggested in a short paper titled \"A Fully Secure Unidirectional and Multi-user Proxy Re-encryption Scheme\" by H. Wang and Z. Cao, published in the proceedings of the ACM Conference on Computer and Communications Security (CCS) in 2009. The algorithm was enhanced in a paper titled \"A Multi-User CCA-Secure Proxy Re-Encryption Scheme\" by Y. Cai and X. Liu, published in the proceedings of the IEEE 12th International Conference on Dependable, Autonomic, and Secure Computing in 2014.\n\nThe algorithms in these papers were very generic and made no implementation choices. They specified only the use of a bilinear pairing function. We made a number of implementation choices. Foremost, we use the optimal Ate pairing as our pairing function. This requires a \"pairing-friendly\" elliptic curve; we chose a Barreto-Naehrig curve, which supports efficient implementation of the pairing.\n\nOur implementation was guided by the following papers:\n\n- \"Pairing-Friendly Elliptic Curves of Prime Order\" by P.S.L.M. Barreto and M. Naehrig, published in _Proceedings of the 12th International Workshop on Selected Areas in Cryptography (SAC)_, 2006, pp. 319-331.\n\n- \"Constructing Tower Extensions of Finite Fields for Implementation of Pairing-Based Cryptography\" by N. Benger and M. Scott, published in _Proceedings of the 3rd International Workshop on Arithmetic of Finite Fields_, 2010, pp. 180-195.\n\n- \"High-Speed Software Implementation of the Optimal Ate Pairing over Barreto-Naehrig Curves\" by J. Beuchat et al., published in _Proceedings from the 4th International Conference on Pairing-Based Cryptography_, 2010, pp. 21-39.\n\n- \"Implementing Cryptographic Pairings over Barreto-Naehrig Curves\" by A. J. Devegili et al., published in _Proceedings from the 1st International Conference on Pairing-Based Cryptography_, 2007, pp. 197-207.\n\n- \"Multiplication and Squaring on Pairing-Friendly Fields\" by A. J. Devegili et al., published in 2006 and available at http://eprint.iacr.org/2006/471.\n\n- \"Faster Squaring in the Cyclotomic Subgroup of Sixth Degree Extensions\" by R. Granger and M. Scott, published in _Proceedings from the 13th International Conferencee on Practice and Theory in Public Key Cryptography (PKC)_, 2010, pp. 209-223.\n\n- \"Multiplication of Multidigit Numbers on Automata\" by A. Karatsuba and Y. Ofman, in the journal _Soviet Physics Doklady_, vol. 7, Jan. 1963.\n\n- \"New Software Speed Records for Cryptographic Pairings\" by M. Naehrig, R. Niederhagen, and P. Schwabe, in _Proceedings of the 1st International Conference on Progress in Cryptology and Information Security in Latin America (LATINCRYPT)_, 2010, pp. 109-123.\n\n- \"On the Final Exponentiation for Calculating Pairings on Ordinary Elliptic Curves\" by M. Scott et al., published in _Proceedings of the 3rd International Converence on Pairing-Based Cryptography (PKC)_, 2009, pp. 78-88.\n\nAnd by the book:\n_Guide to Pairing-Based Cryptography_ by N.E. Mrabet and M. Joye, Chapman and Hall/CRC Cryptography and Network Security Series, 2016.\n\n## Code Audit\n\nThe NCC Group has conducted an audit of this library - we have a blog post about the audit [here](https://blog.ironcorelabs.com/ironcore-labs-proxy-re-encryption-library-audit-by-ncc-group-f67abe666838), and their findings are available in a public report [here](https://www.nccgroup.com/us/research-blog/proxy-re-encryption-protocol-ironcore-public-report/). The NCC Group audit found that the chosen pairing and elliptic curve are cryptographically sound and secure, and that the Scala implementation is a faithful and correct embodiment of the target protocol.\n\n## Building\n\nRecrypt requires openjdk8+ and is known to build under Linux and MacOSX.\n\nhttps://github.com/paulp/sbt-extras can be used to get sbt.\n\nAfter you have `java` and `sbt`, simply go into the recrypt directory and run:\n\n```\n$ sbt compile\n```\n\n## Running Tests\n\nTo run tests just run `sbt test` from the root of the project. This will test everything, but will not run the benchmarks.\n\n## Benchmarks\n\n### Scala\n\nRunning the benchmarks in scala requires `libsodium-dev`. Any recent binary version from a package manager should be fine.\n\nSee https://github.com/jedisct1/libsodium\n\nThis version is known to work on Ubuntu 16.04\n\n```\nlibsodium-dev/xenial,now 1.0.8-5 amd64 [installed]\n  Network communication, cryptography and signaturing library - headers\n```\n\nTo run the benchmarks, run the following from sbt:\n\n`benchmark/Jmh/run -wi 10 -i 15 -f1 -t1 bench.*`\n\nThe parameters used here are:\n\n- `-wi`: the number of times to run during warmup\n- `-i`: the number of times to each benchmark\n- `-f`: the number of processes to use during benchmarking\n- `-t`: the number of threads to use during benchmarking\n\nThe above command will use a single thread warming up 10 times on each and running each test 15 times.\n\n# Intellectual Property\n\nRecrypt-rust incorporates technology that is protected by the following patents (additional patents may be pending in the U.S. and elsewhere):\n\n- US 10,659,222 - Orthogonal Access Control for Groups via Multi-Hop Transform Encryption\n- US 11,146,391 - Orthogonal Access Control for Groups via Multi-Hop Transform Encryption\n- WO2018201062A1 - Orthogonal Access Control for Groups via Multi-Hop Transform Encryption\n- EP3616384A4 - Orthogonal Access Control for Groups via Multi-Hop Transform Encryption\n- KR20200027921 A - Orthogonal Access Control for Groups via Multi-Hop Transform Encryption\n\n# Cryptography Notice\n\nThis repository includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See https://www.wassenaar.org/ for more information.\n\nThe U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002, which includes information security software using or performing cryptographic functions. The form and manner of this distribution makes it eligible for export under the License Exception ENC (see the BIS Export Administration Regulations, Section 740.17.B.3.i.B and also the publicly available source code exemption, under 742.15; notice has been given to BIS and NSA).\n\n# License\n\nRecrypt is licensed under the [GNU Affero General Public License](LICENSE).\nWe also offer commercial licenses - [email](mailto:info@ironcorelabs.com) for more information.\n\nCopyright (c) 2017-present IronCore Labs, Inc.\nAll rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIronCoreLabs%2Frecrypt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIronCoreLabs%2Frecrypt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIronCoreLabs%2Frecrypt/lists"}