{"id":28829271,"url":"https://github.com/ballerina-platform/module-ballerina-crypto","last_synced_at":"2026-04-28T11:01:44.036Z","repository":{"id":38466930,"uuid":"288615301","full_name":"ballerina-platform/module-ballerina-crypto","owner":"ballerina-platform","description":"Ballerina crypto Module","archived":false,"fork":false,"pushed_at":"2026-04-28T09:12:13.000Z","size":1922,"stargazers_count":112,"open_issues_count":2,"forks_count":38,"subscribers_count":67,"default_branch":"master","last_synced_at":"2026-04-28T10:03:53.838Z","etag":null,"topics":["ballerina","crypto","cryptography","encryption","hacktoberfest","integration","security","wso2"],"latest_commit_sha":null,"homepage":"","language":"Ballerina","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ballerina-platform.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"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":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-08-19T02:38:37.000Z","updated_at":"2026-04-28T09:08:22.000Z","dependencies_parsed_at":"2023-01-30T05:45:24.177Z","dependency_job_id":"5faf5725-50f5-4f4f-890b-0fd5dbef8f37","html_url":"https://github.com/ballerina-platform/module-ballerina-crypto","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/ballerina-platform/module-ballerina-crypto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-crypto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-crypto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-crypto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-crypto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ballerina-platform","download_url":"https://codeload.github.com/ballerina-platform/module-ballerina-crypto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballerina-platform%2Fmodule-ballerina-crypto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ballerina","crypto","cryptography","encryption","hacktoberfest","integration","security","wso2"],"created_at":"2025-06-19T05:12:38.191Z","updated_at":"2026-04-28T11:01:43.994Z","avatar_url":"https://github.com/ballerina-platform.png","language":"Ballerina","funding_links":[],"categories":[],"sub_categories":[],"readme":"Ballerina Crypto Library\n===================\n\n  [![Build](https://github.com/ballerina-platform/module-ballerina-crypto/actions/workflows/build-timestamped-master.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-crypto/actions/workflows/build-timestamped-master.yml)\n  [![codecov](https://codecov.io/gh/ballerina-platform/module-ballerina-crypto/branch/master/graph/badge.svg)](https://codecov.io/gh/ballerina-platform/module-ballerina-crypto)\n  [![Trivy](https://github.com/ballerina-platform/module-ballerina-crypto/actions/workflows/trivy-scan.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-crypto/actions/workflows/trivy-scan.yml)\n  [![GraalVM Check](https://github.com/ballerina-platform/module-ballerina-crypto/actions/workflows/build-with-bal-test-graalvm.yml/badge.svg)](https://github.com/ballerina-platform/module-ballerina-crypto/actions/workflows/build-with-bal-test-graalvm.yml)\n  [![GitHub Last Commit](https://img.shields.io/github/last-commit/ballerina-platform/module-ballerina-crypto.svg?label=Last%20Commit)](https://github.com/ballerina-platform/module-ballerina-crypto/commits/master)\n  [![GitHub issues](https://img.shields.io/github/issues/ballerina-platform/ballerina-standard-library/module/crypto.svg?label=Open%20Issues)](https://github.com/ballerina-platform/ballerina-standard-library/labels/module%2Fcrypto)\n\nThis library provides common cryptographic mechanisms based on different algorithms.\n\nThe Ballerina `crypto` library facilitates APIs to do operations like hashing, HMAC generation, checksum generation, encryption, decryption, signing data digitally, verifying digitally signed data, etc., with different cryptographic algorithms.\n\n### Hashes\n\nThe `crypto` library supports generating hashes with 6 different hash algorithms MD5, SHA1, SHA256, SHA384, SHA512, and Keccak256. Also, it supports generating the CRC32B checksum.\n\n### HMAC\n\nThe `crypto` library supports generating HMAC with 5 different hash algorithms: MD5, SHA1, SHA256, SHA384, and SHA512.\n\n### Decode private/public key\n\nThe `crypto` library supports decoding the RSA private key from a `.p12` file and a key file in the `PEM` format. Also, it supports decoding a public key from a `.p12` file and a certificate file in the `X509` format. Additionally, this supports building an RSA public key with the modulus and exponent parameters.\n\n### Encrypt and decrypt\n\nThe `crypto` library supports both symmetric key encryption/decryption and asymmetric key encryption/decryption. The RSA algorithm can be used for asymmetric-key encryption/decryption with the use of private and public keys. The AES algorithm can be used for symmetric-key encryption/decryption with the use of a shared key.\n\n### Sign and verify\n\nThe `crypto` library supports signing data using the RSA private key and verification of the signature using the RSA public key. This supports MD5, SHA1, SHA256, SHA384, and SHA512 digesting algorithms, and ML-DSA-65 post-quantum signature algorithm as well.\n\n### Key Derivation Function (KDF)\n\nThe `crypto` module supports HMAC-based Key Derivation Function (HKDF). HKDF is a key derivation function that uses a Hash-based Message Authentication Code (HMAC) to derive keys.\n\n### Key Exchange Mechanism (KEM)\n\nThe `crypto` module supports Key Exchange Mechanisms (KEM). It includes RSA-KEM and post-quantum ML-KEM-768 for both encapsulation and decapsulation.\n\n### Hybrid Public Key Encryption (HPKE)\n\nThe `crypto` module supports Hybrid Public Key Encryption (HPKE). It supports post-quantum ML-KEM-768-HPKE and RSA-KEM-ML-KEM-768-HPKE for encryption and decryption.\n\n## Issues and projects\n\nIssues and Projects tabs are disabled for this repository as this is part of the Ballerina Standard Library. To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Standard Library parent repository](https://github.com/ballerina-platform/ballerina-standard-library).\n\nThis repository only contains the source code for the module.\n\n## Build from the source\n\n### Set up the prerequisites\n\n1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).\n\n   * [Oracle](https://www.oracle.com/java/technologies/downloads/)\n   \n   * [OpenJDK](https://adoptium.net)\n   \n        \u003e **Note:** Set the `JAVA_HOME` environment variable to the path name of the directory into which you installed JDK.\n\n2. Export your GitHub Personal Access Token (PAT) with the `read package` permission as follows:\n\n    ```\n    export packageUser=\u003cUsername\u003e\n    export packagePAT=\u003cPersonal Access Token\u003e\n    ```\n\n### Build the source\n\nExecute the commands below to build from the source.\n\n1. To build the package:\n    ```    \n    ./gradlew clean build\n    ```\n2. To run the tests:\n    ```\n    ./gradlew clean test\n    ```\n\n3. To run a group of tests\n    ```\n    ./gradlew clean test -Pgroups=\u003ctest_group_names\u003e\n    ```\n\n4. To build the without the tests:\n    ```\n    ./gradlew clean build -x test\n    ```\n\n5. To debug package implementation:\n    ```\n    ./gradlew clean build -Pdebug=\u003cport\u003e\n    ```\n\n6. To debug with Ballerina language:\n    ```\n    ./gradlew clean build -PbalJavaDebug=\u003cport\u003e\n    ```\n\n7. Publish the generated artifacts to the local Ballerina central repository:\n    ```\n    ./gradlew clean build -PpublishToLocalCentral=true\n    ```\n\n8. Publish the generated artifacts to the Ballerina central repository:\n    ```\n    ./gradlew clean build -PpublishToCentral=true\n    ```\n\n## Contribute to Ballerina\n\nAs an open source project, Ballerina welcomes contributions from the community.\n\nFor more information, go to the [contribution guidelines](https://github.com/ballerina-platform/ballerina-lang/blob/master/CONTRIBUTING.md).\n\n## Code of conduct\n\nAll contributors are encouraged to read the [Ballerina Code of Conduct](https://ballerina.io/code-of-conduct).\n\n## Useful links\n\n* For more information go to the [`crypto` library](https://lib.ballerina.io/ballerina/crypto/latest).\n* For example demonstrations of the usage, go to [Ballerina By Examples](https://ballerina.io/learn/by-example/).\n* Chat live with us via our [Discord server](https://discord.gg/ballerinalang).\n* Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-crypto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-crypto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballerina-platform%2Fmodule-ballerina-crypto/lists"}