{"id":37029448,"url":"https://github.com/dimchat/dkd-java","last_synced_at":"2026-01-14T03:32:13.665Z","repository":{"id":57715679,"uuid":"182742914","full_name":"dimchat/dkd-java","owner":"dimchat","description":"Dao Ke Dao (道可道) -- Message Module","archived":false,"fork":false,"pushed_at":"2025-12-15T08:49:45.000Z","size":463,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-16T12:32:35.943Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimchat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-22T10:07:02.000Z","updated_at":"2025-12-15T08:49:49.000Z","dependencies_parsed_at":"2024-08-29T06:27:36.252Z","dependency_job_id":"889eecdb-802b-4999-bd5c-730650374b20","html_url":"https://github.com/dimchat/dkd-java","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dimchat/dkd-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fdkd-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fdkd-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fdkd-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fdkd-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimchat","download_url":"https://codeload.github.com/dimchat/dkd-java/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fdkd-java/sbom","scorecard":{"id":24012,"data":{"date":"2025-08-11","repo":{"name":"github.com/dimchat/dkd-java","commit":"88723117aafe12391837b8a252ff38646e7a674b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Maintained","score":7,"reason":"9 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: DaoKeDao/gradle/wrapper/gradle-wrapper.jar:1"],"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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"}}]},"last_synced_at":"2025-08-14T17:26:16.949Z","repository_id":57715679,"created_at":"2025-08-14T17:26:16.950Z","updated_at":"2025-08-14T17:26:16.950Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":[],"created_at":"2026-01-14T03:32:12.953Z","updated_at":"2026-01-14T03:32:13.652Z","avatar_url":"https://github.com/dimchat.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dao Ke Dao (道可道) -- Message Module (Java)\n\n[![License](https://img.shields.io/github/license/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/dimchat/dkd-java/pulls)\n[![Platform](https://img.shields.io/badge/Platform-Java%208-brightgreen.svg)](https://github.com/dimchat/dkd-java/wiki)\n[![Issues](https://img.shields.io/github/issues/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/issues)\n[![Repo Size](https://img.shields.io/github/repo-size/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/archive/refs/heads/master.zip)\n[![Tags](https://img.shields.io/github/tag/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/tags)\n[![Version](https://img.shields.io/maven-central/v/chat.dim/DaoKeDao)](https://mvnrepository.com/artifact/chat.dim/DaoKeDao)\n\n[![Watchers](https://img.shields.io/github/watchers/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/watchers)\n[![Forks](https://img.shields.io/github/forks/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/forks)\n[![Stars](https://img.shields.io/github/stars/dimchat/dkd-java)](https://github.com/dimchat/dkd-java/stargazers)\n[![Followers](https://img.shields.io/github/followers/dimchat)](https://github.com/orgs/dimchat/followers)\n\nThis [document](https://github.com/moky/DIMP/blob/master/DaoKeDao-Message.md) introduces a common **Message Module** for decentralized instant messaging.\n\n## Features\n\n- [Envelope](#envelope)\n    - Sender\n    - Receiver\n    - Time (same value from content.time)\n- [Content](#content)\n    - [Type](#content-type)\n    - Serial Number\n    - Time\n    - Group _(Optional)_\n- [Message](#message)\n    - [Instant Message](#instant-message)\n    - [Secure Message](#secure-message)\n    - [Reliable Message](#reliable-message)\n\n## Envelope\n\n### Message Envelope\n\n```javascript\n/* example */\n{\n    \"sender\"   : \"moki@4WDfe3zZ4T7opFSi3iDAKiuTnUHjxmXekk\",\n    \"receiver\" : \"hulk@4YeVEN3aUnvC1DNUufCq1bs9zoBSJTzVEj\",\n    \"time\"     : 1545405083\n}\n```\n\n## Content\n\n```javascript\n/* example */\n{\n    \"type\"     : \"1\",       // message type\n    \"sn\"       : 412968873, // serial number (message ID in conversation)\n    \n    \"text\"     : \"Hey guy!\"\n}\n```\n\n### Content Type\n\n```java\npublic enum ContentType {\n\n    ANY       (0x00), // 0000 0000 (Undefined)\n\n    TEXT      (0x01), // 0000 0001\n\n    FILE      (0x10), // 0001 0000\n    IMAGE     (0x12), // 0001 0010\n    AUDIO     (0x14), // 0001 0100\n    VIDEO     (0x16), // 0001 0110\n\n    // Web Page\n    PAGE      (0x20), // 0010 0000\n    \n    // Name Card\n    NAME_CARD (0x33), // 0011 0011\n\n    // Quote a message before and reply it with text\n    QUOTE     (0x37), // 0011 0111\n\n    // Money\n    MONEY         (0x40), // 0100 0000\n    TRANSFER      (0x41), // 0100 0001\n    LUCKY_MONEY   (0x42), // 0100 0010\n    CLAIM_PAYMENT (0x48), // 0100 1000 (Claim for Payment)\n    SPLIT_BILL    (0x49), // 0100 1001 (Split the Bill)\n\n    // Command\n    COMMAND       (0x88), // 1000 1000\n    HISTORY       (0x89), // 1000 1001 (Entity history command)\n\n    // Application Customized\n    APPLICATION       (0xA0), // 1010 0000 (Application 0nly, Reserved)\n    // APPLICATION_1  (0xA1), // 1010 0001 (Reserved)\n    // ...                    // 1010 ???? (Reserved)\n    // APPLICATION_15 (0xAF), // 1010 1111 (Reserved)\n\n    // CUSTOMIZED_0   (0xC0), // 1100 0000 (Reserved)\n    // CUSTOMIZED_1   (0xC1), // 1100 0001 (Reserved)\n    // ...                    // 1100 ???? (Reserved)\n    ARRAY             (0xCA), // 1100 1010 (Content Array)\n    // ...                    // 1100 ???? (Reserved)\n    CUSTOMIZED        (0xCC), // 1100 1100 (Customized Content)\n    // ...                    // 1100 ???? (Reserved)\n    COMBINE_FORWARD   (0xCF), // 1100 1111 (Combine and Forward)\n\n    /// Top-Secret message forward by proxy (MTA)\n    FORWARD           (0xFF); // 1111 1111\n\n    public final int value;\n\n    ContentType(int value) {\n        this.value = value;\n    }\n}\n```\n\n## Message\n\nWhen the user want to send out a message, the client needs TWO steps before sending it:\n\n1. Encrypt the **Instant Message** to **Secure Message**;\n2. Sign the **Secure Message** to **Reliable Message**.\n\nAccordingly, when the client received a message, it needs TWO steps to extract the content:\n\n1. Verify the **Reliable Message** to **Secure Message**;\n2. Decrypt the **Secure Message** to **Instant Message**.\n\n```\n    Message Transforming\n    ~~~~~~~~~~~~~~~~~~~~\n\n    Instant Message  \u003c--\u003e  Secure Message  \u003c--\u003e  Reliable Message\n    +-------------+        +------------+        +--------------+\n    |  sender     |        |  sender    |        |  sender      |\n    |  receiver   |        |  receiver  |        |  receiver    |\n    |  time       |        |  time      |        |  time        |\n    |             |        |            |        |              |\n    |  content    |        |  data      |        |  data        |\n    +-------------+        |  key/keys  |        |  key/keys    |\n                           +------------+        |  signature   |\n                                                 +--------------+\n    Algorithm:\n        data      = password.encrypt(content)\n        key       = receiver.public_key.encrypt(password)\n        signature = sender.private_key.sign(data)\n\n```\n\n### Instant Message\n\n```javascript\n/* example */\n{\n    //-------- head (envelope) --------\n    \"sender\"   : \"moki@4WDfe3zZ4T7opFSi3iDAKiuTnUHjxmXekk\",\n    \"receiver\" : \"hulk@4YeVEN3aUnvC1DNUufCq1bs9zoBSJTzVEj\",\n    \"time\"     : 1545405083,\n    \n    //-------- body (content) ---------\n    \"content\"  : {\n        \"type\" : \"1\",       // message type\n        \"sn\"   : 412968873, // serial number (ID)\n        \"text\" : \"Hey guy!\"\n    }\n}\n```\n\ncontent -\u003e JsON string: ```{\"sn\":412968873,\"text\":\"Hey guy!\",\"type\":1}```\n\n### Secure Message\n\n```javascript\n/**\n *  Algorithm:\n *      string = json(content);\n *      PW     = random();\n *      data   = encrpyt(string, PW);      // Symmetric\n *      key    = encrypt(PW, receiver.PK); // Asymmetric\n */\n{\n    //-------- head (envelope) --------\n    \"sender\"   : \"moki@4WDfe3zZ4T7opFSi3iDAKiuTnUHjxmXekk\",\n    \"receiver\" : \"hulk@4YeVEN3aUnvC1DNUufCq1bs9zoBSJTzVEj\",\n    \"time\"     : 1545405083,\n    \n    //-------- body (content) ---------\n    \"data\"     : \"9cjCKG99ULCCxbL2mkc/MgF1saeRqJaCc+S12+HCqmsuF7TWK61EwTQWZSKskUeF\",\n    \"key\"      : \"WH/wAcu+HfpaLq+vRblNnYufkyjTm4FgYyzW3wBDeRtXs1TeDmRxKVu7nQI/sdIALGLXrY+O5mlRfhU8f8TuIBilZUlX/eIUpL4uSDYKVLaRG9pOcrCHKevjUpId9x/8KBEiMIL5LB0Vo7sKrvrqosCnIgNfHbXMKvMzwcqZEU8=\"\n}\n```\n\n### Reliable Message\n\n```javascript\n/**\n *  Algorithm:\n *      signature = sign(data, sender.SK);\n */\n{\n    //-------- head (envelope) --------\n    \"sender\"   : \"moki@4WDfe3zZ4T7opFSi3iDAKiuTnUHjxmXekk\",\n    \"receiver\" : \"hulk@4YeVEN3aUnvC1DNUufCq1bs9zoBSJTzVEj\",\n    \"time\"     : 1545405083,\n    \n    //-------- body (content) ---------\n    \"data\"      : \"9cjCKG99ULCCxbL2mkc/MgF1saeRqJaCc+S12+HCqmsuF7TWK61EwTQWZSKskUeF\",\n    \"key\"       : \"WH/wAcu+HfpaLq+vRblNnYufkyjTm4FgYyzW3wBDeRtXs1TeDmRxKVu7nQI/sdIALGLXrY+O5mlRfhU8f8TuIBilZUlX/eIUpL4uSDYKVLaRG9pOcrCHKevjUpId9x/8KBEiMIL5LB0Vo7sKrvrqosCnIgNfHbXMKvMzwcqZEU8=\",\n    \"signature\" : \"Yo+hchWsQlWHtc8iMGS7jpn/i9pOLNq0E3dTNsx80QdBboTLeKoJYAg/lI+kZL+g7oWJYpD4qKemOwzI+9pxdMuZmPycG+0/VM3HVSMcguEOqOH9SElp/fYVnm4aSjAJk2vBpARzMT0aRNp/jTFLawmMDuIlgWhBfXvH7bT7rDI=\"\n}\n```\n\n(All data encode with **BASE64** algorithm as default)\n\n----\n\nCopyright \u0026copy; 2018-2025 Albert Moky\n[![Followers](https://img.shields.io/github/followers/moky)](https://github.com/moky?tab=followers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimchat%2Fdkd-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimchat%2Fdkd-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimchat%2Fdkd-java/lists"}