{"id":19371920,"url":"https://github.com/chatsecure/otrkit","last_synced_at":"2025-04-10T02:29:20.342Z","repository":{"id":3175070,"uuid":"4206518","full_name":"ChatSecure/OTRKit","owner":"ChatSecure","description":"An Objective-C Off-the-Record library for iOS.","archived":false,"fork":false,"pushed_at":"2022-07-21T22:59:08.000Z","size":9159,"stargazers_count":135,"open_issues_count":15,"forks_count":55,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-03T00:07:20.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://chatsecure.org","language":"Objective-C","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/ChatSecure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.LGPLv2.1","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-02T19:00:24.000Z","updated_at":"2024-07-26T18:32:32.000Z","dependencies_parsed_at":"2022-09-05T03:40:29.385Z","dependency_job_id":null,"html_url":"https://github.com/ChatSecure/OTRKit","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FOTRKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FOTRKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FOTRKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChatSecure%2FOTRKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChatSecure","download_url":"https://codeload.github.com/ChatSecure/OTRKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144011,"owners_count":21054865,"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":[],"created_at":"2024-11-10T08:20:31.079Z","updated_at":"2025-04-10T02:29:20.301Z","avatar_url":"https://github.com/ChatSecure.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OTRKit\n[![Build Status](https://travis-ci.org/ChatSecure/OTRKit.svg?branch=master)](https://travis-ci.org/ChatSecure/OTRKit)\n\n[OTRKit](https://github.com/ChatSecure/OTRKit) is an Objective-C wrapper for the [OTRv3](http://en.wikipedia.org/wiki/Off-the-Record_Messaging) encrypted messaging protocol, using [libotr](https://otr.cypherpunks.ca). This library was designed for use with the encrypted iOS messaging app [ChatSecure](https://github.com/chrisballinger/ChatSecure-iOS), but should theoretically work for Mac OS X as well with some minor tweaking to the build scripts.\n\n### Dependencies\n\n* [libgpg-error](https://www.gnupg.org/(de)/related_software/libgpg-error/index.html)\n* [libgcrypt](http://www.gnu.org/software/libgcrypt/)\n* [libotr](https://otr.cypherpunks.ca)\n\n## Installation\n\nTo compile libotr and dependencies for iOS, run the included script, `build-all.sh`.\n\n    $ bash build-all.sh\n\n### Cocoapods\n\nWe now support Cocoapods but haven't pushed `OTRKit.podspec` to the public repository yet. Feel free to use the one in this repo in the meantime, but the public API may change slightly before release.\n\n    pod 'OTRKit', :git =\u003e 'https://github.com/ChatSecure/OTRKit.git'\n\n## Usage\n\nCheck out [OTRKit.h](https://github.com/ChatSecure/OTRKit/blob/master/OTRKit/OTRKit.h) because it is the most up-to-date reference at the moment.\n\nImplement the required delegate methods somewhere that makes sense for your project.\n\n```obj-c\n@protocol OTRKitDelegate \u003cNSObject\u003e\n@required\n/**\n *  This method **MUST** be implemented or OTR will not work. All outgoing messages\n *  should be sent first through OTRKit encodeMessage and then passed from this delegate\n *  to the appropriate chat protocol manager to send the actual message.\n *\n *  @param otrKit      reference to shared instance\n *  @param message     message to be sent over the network. may contain ciphertext.\n *  @param recipient   intended recipient of the message\n *  @param accountName your local account name\n *  @param protocol    protocol for account name such as \"xmpp\"\n *  @param tag optional tag to attached to message. Only used locally.\n */\n- (void) otrKit:(OTRKit*)otrKit\n  injectMessage:(NSString*)message\n       username:(NSString*)username\n    accountName:(NSString*)accountName\n       protocol:(NSString*)protocol\n            tag:(id)tag;\n\n/**\n *  All outgoing messages should be sent to the OTRKit encodeMessage method before being\n *  sent over the network.\n *\n *  @param otrKit      reference to shared instance\n *  @param message     plaintext message\n *  @param sender      buddy who sent the message\n *  @param accountName your local account name\n *  @param protocol    protocol for account name such as \"xmpp\"\n *  @param tag optional tag to attach additional application-specific data to message. Only used locally.\n */\n- (void) otrKit:(OTRKit*)otrKit\n encodedMessage:(NSString*)encodedMessage\n       username:(NSString*)username\n    accountName:(NSString*)accountName\n       protocol:(NSString*)protocol\n            tag:(id)tag\n          error:(NSError*)error;\n\n\n/**\n *  All incoming messages should be sent to the OTRKit decodeMessage method before being\n *  processed by your application. You should only display the messages coming from this delegate method.\n *\n *  @param otrKit      reference to shared instance\n *  @param message     plaintext message\n *  @param tlvs        OTRTLV values that may be present.\n *  @param sender      buddy who sent the message\n *  @param accountName your local account name\n *  @param protocol    protocol for account name such as \"xmpp\"\n *  @param tag optional tag to attach additional application-specific data to message. Only used locally.\n */\n- (void) otrKit:(OTRKit*)otrKit\n decodedMessage:(NSString*)decodedMessage\n           tlvs:(NSArray*)tlvs\n       username:(NSString*)username\n    accountName:(NSString*)accountName\n       protocol:(NSString*)protocol\n            tag:(id)tag;\n\n/**\n *  When the encryption status changes this method is called\n *\n *  @param otrKit      reference to shared instance\n *  @param messageState plaintext, encrypted or finished\n *  @param username     buddy whose state has changed\n *  @param accountName your local account name\n *  @param protocol    protocol for account name such as \"xmpp\"\n */\n- (void)    otrKit:(OTRKit*)otrKit\nupdateMessageState:(OTRKitMessageState)messageState\n          username:(NSString*)username\n       accountName:(NSString*)accountName\n          protocol:(NSString*)protocol;\n...\n```\n\nTo encode a message:\n\n```obj-c\n/**\n * Encodes a message and optional array of OTRTLVs, splits it into fragments,\n * then injects the encoded data via the injectMessage: delegate method.\n * @param message The message to be encoded\n * @param tlvs Array of OTRTLVs, the data length of each TLV must be smaller than UINT16_MAX or it will be ignored.\n * @param recipient The intended recipient of the message\n * @param accountName Your account name\n * @param protocol the protocol of accountName, such as @\"xmpp\"\n *  @param tag optional tag to attach additional application-specific data to message. Only used locally.\n */\n- (void)encodeMessage:(NSString*)message\n                 tlvs:(NSArray*)tlvs\n             username:(NSString*)username\n          accountName:(NSString*)accountName\n             protocol:(NSString*)protocol\n                  tag:(id)tag;\n```\n\nTo decode a message:\n\n```obj-c\n/**\n *  All messages should be sent through here before being processed by your program.\n *\n *  @param message     Encoded or plaintext incoming message\n *  @param sender      account name of buddy who sent the message\n *  @param accountName your account name\n *  @param protocol    the protocol of accountName, such as @\"xmpp\"\n *  @param tag optional tag to attach additional application-specific data to message. Only used locally.\n */\n- (void)decodeMessage:(NSString*)message\n             username:(NSString*)username\n          accountName:(NSString*)accountName\n             protocol:(NSString*)protocol\n                  tag:(id)tag;\n```\n\n## TODO\n\n* Documentation!\n* Add Mac OS X support\n* Tests\n\n## Contributing\n\nPlease fork the project and submit a pull request and (preferrably) squash your commits. Thank you! If you're interested in privacy and security, check out [chatsecure.org](https://chatsecure.org) and [The Guardian Project](https://guardianproject.info).\n\n\n## License\n\nThe code for this project is dual licensed under the [LGPLv2.1+](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) and [MPL 2.0](http://www.mozilla.org/MPL/2.0/). The required dependencies are under terms of a seperate license (LGPL). More information is available in the [LICENSE](https://github.com/ChatSecure/OTRKit/blob/master/LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatsecure%2Fotrkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchatsecure%2Fotrkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatsecure%2Fotrkit/lists"}