{"id":20459599,"url":"https://github.com/ticesoftware/doubleratchet","last_synced_at":"2025-04-13T05:51:16.690Z","repository":{"id":56138537,"uuid":"185390426","full_name":"TICESoftware/DoubleRatchet","owner":"TICESoftware","description":"Implementation of the Double Ratchet protocol in Swift based on libsodium.","archived":false,"fork":false,"pushed_at":"2021-06-01T13:19:14.000Z","size":57,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T22:36:08.167Z","etag":null,"topics":["tice-app","tice-crypto"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/TICESoftware.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}},"created_at":"2019-05-07T11:46:36.000Z","updated_at":"2024-12-10T12:36:04.000Z","dependencies_parsed_at":"2022-08-15T13:21:09.792Z","dependency_job_id":null,"html_url":"https://github.com/TICESoftware/DoubleRatchet","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TICESoftware%2FDoubleRatchet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TICESoftware%2FDoubleRatchet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TICESoftware%2FDoubleRatchet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TICESoftware%2FDoubleRatchet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TICESoftware","download_url":"https://codeload.github.com/TICESoftware/DoubleRatchet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670500,"owners_count":21142901,"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":["tice-app","tice-crypto"],"created_at":"2024-11-15T12:16:44.950Z","updated_at":"2025-04-13T05:51:16.660Z","avatar_url":"https://github.com/TICESoftware.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DoubleRatchet\n\nImplementation of the \u003ca href=\"https://www.signal.org/docs/specifications/doubleratchet/#external-functions\"\u003eDouble Ratchet\u003c/a\u003e protocol in Swift. The cryptographic operations are provided by \u003ca href=\"https://github.com/jedisct1/libsodium\"\u003elibsodium\u003c/a\u003e entirely.\n\n## Installation\n### SPM\n`.package(url: \"https://github.com/TICESoftware/DoubleRatchet.git\", .upToNextMajor(from: \"1.0.0\"))`\n\nIn order to build the library it is necessary to link libsodium. The \u003ca href=\"https://github.com/jedisct1/libsodium\"\u003eofficial repository\u003c/a\u003e includes scripts to build binaries for specific platforms.\n\n`swift build -Xcc -I[header search path] -Xlinker -L[binary path]`\n\nWhen using Xcode you can set the header search path manually to include the libsodium header files and link the static libsodium library.\n\n### CodoaPods\n`pod 'DoubleRatchet'`\n\nThis uses \u003ca href=\"https://github.com/jedisct1/swift-sodium\"\u003e`Sodium`\u003c/a\u003e as a dependency which includes the pre-compiled libsodium library. No further setup necessary.\n\n## Usage\n\nAlice and Bob calculate a shared secret using a secure channel. After that one party can start the conversation as soon as she gets to know the public key of the other one.\n\n```swift\nimport DoubleRatchet\n\nlet sharedSecret: Bytes = ...\nlet info = \"DoubleRatchetExample\"\n\nlet bob = try DoubleRatchet(keyPair: nil, remotePublicKey: nil, sharedSecret: sharedSecret, maxSkip: 20, maxCache: 20, info: info)\n\n// Bob sends his public key to Alice using another channel\n// sendToAlice(bob.publicKey)\n\nlet alice = try DoubleRatchet(keyPair: nil, remotePublicKey: bob.publicKey, sharedSecret: sharedSecret, maxSkip: 20, maxCache: 20, info: info)\n\n// Now the conversation begins\nlet message = \"Hello, Bob!\".bytes\nlet encryptedMessage = try alice.encrypt(plaintext: message)\nlet decryptedMessage = try bob.decrypt(message: encryptedMessage)\n\nprint(decryptedMessage.utf8String!) // Hello, Bob!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fticesoftware%2Fdoubleratchet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fticesoftware%2Fdoubleratchet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fticesoftware%2Fdoubleratchet/lists"}