{"id":15395478,"url":"https://github.com/stef/libsaxolotl","last_synced_at":"2025-04-16T00:08:03.745Z","repository":{"id":66440193,"uuid":"63878205","full_name":"stef/libsaxolotl","owner":"stef","description":"axolotl based on libsodium","archived":false,"fork":false,"pushed_at":"2016-07-25T21:44:20.000Z","size":76,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-16T00:07:50.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stef.png","metadata":{"files":{"readme":"README.org","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-07-21T14:52:37.000Z","updated_at":"2023-09-08T17:12:53.000Z","dependencies_parsed_at":"2023-06-29T13:14:10.748Z","dependency_job_id":null,"html_url":"https://github.com/stef/libsaxolotl","commit_stats":{"total_commits":20,"total_committers":1,"mean_commits":20.0,"dds":0.0,"last_synced_commit":"4bfdb790f2331870e4daedb0b3bb52cd422369fe"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Flibsaxolotl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Flibsaxolotl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Flibsaxolotl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stef%2Flibsaxolotl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stef","download_url":"https://codeload.github.com/stef/libsaxolotl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173084,"owners_count":21224483,"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-10-01T15:28:28.663Z","updated_at":"2025-04-16T00:08:03.728Z","avatar_url":"https://github.com/stef.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"* libsaxolotl v0.1\nlibsaxolotl implements the Axoltol protocol using curve25519 from libsodium in a LGPLv3+ library.\n\nthis library implements a variation, where the skipped header keys are\nnot retained and hence not used when trying to decrypt out-of-band\nmessages.\n\nThe axolotl context is 769 bytes, with 16 slots for the latest missed\nmessage keys. The initial handshake message (which can be produced in\nbulk and used for setting up channels asynchronously) is 96\nbytes. Encrypted messages have an overhead of 128 bytes.\n\n** API\n#+BEGIN_EXAMPLE\nvoid axolotl_genid(Axolotl_KeyPair * keys);\n#+END_EXAMPLE\n\nInitializes a long-term identity key. This long-term key is the authenticating the persona to all peers.\n\n#+BEGIN_EXAMPLE\nvoid axolotl_prekey(Axolotl_PreKey *prekey, Axolotl_ctx *ctx, const Axolotl_KeyPair *keypair);\n#+END_EXAMPLE\n\nCreates the initial handshake to be exchanged for setting up an\nAxolotl channel. The pointer to the prekey is the initial packet that\nneeds to be shared with *1* peer, reuse of these prekeys is not\nrecommended. ctx is a pointer to a new Axolotl_ctx object, which needs\nto be preserved across the life-time of the connection. keypair is the\nlong-term identity key for the persona generating the handshake message.\n\nIt is important to note that each prekey is coupled with a context,\nfor correct setup the context according to the prekey must be used.\n\nGenerating and serving many of these prekeys centrally allows for\nasynchronous messaging. but this is not necessary.\n\n#+BEGIN_EXAMPLE\nint axolotl_handshake(Axolotl_ctx* ctx, const Axolotl_PreKey *prekey);\n#+END_EXAMPLE\n\nReceives an initial handshake and derives the initial context. ctx is\nthe persistent context of the Axolotl channel. prekey is one of the\ncommunicating peers prekeys, this should be discarded, and never used\nagain after using once. Both peers must execute this with each others\nprekeys before they can exchange messages.\n\nThe ctx must be the one coupled with the prekeys sent to the peer. The\nprekeys similarly must be the one associated with the ctx of the peer.\n\n#+BEGIN_EXAMPLE\nvoid axolotl_box(Axolotl_ctx *ctx, uint8_t *out, int *out_len, const uint8_t *in, const int in_len);\n#+END_EXAMPLE\n\nEncrypts a message /in/ using the axolotl context ctx into /out/;\n\n#+BEGIN_EXAMPLE\nint axolotl_box_open(Axolotl_ctx *ctx, uint8_t *out, int *out_len, const uint8_t *in, const int in_len);\n#+END_EXAMPLE\n\ndecrypts a message /in/ using the axolotl context ctx into /out/;\n\na quick example for exchange between alice and bob:\n\n#+BEGIN_EXAMPLE\n#include \"axolotl.h\"\n\nvoid main(void) {\n  Axolotl_ctx alice_ctx, bob_ctx;\n  Axolotl_KeyPair alice_id, bob_id;\n  Axolotl_PreKey alice_prekey, bob_prekey;\n\n  // init long-term identity keys\n  axolotl_genid(\u0026alice_id);\n  axolotl_genid(\u0026bob_id);\n\n  axolotl_prekey(\u0026alice_prekey, \u0026alice_ctx, \u0026alice_id);\n  axolotl_prekey(\u0026bob_prekey, \u0026bob_ctx, \u0026bob_id);\n\n  // both derive the ctx from their exchanged prekey msg\n  axolotl_handshake(\u0026alice_ctx, \u0026bob_prekey);\n  axolotl_handshake(\u0026bob_ctx, \u0026alice_prekey);\n\n  uint8_t out[4096], out2[4096];\n  int outlen,outlen2;\n  axolotl_box(\u0026alice_ctx, out, \u0026outlen, (const uint8_t *) \"howdy\", 6);\n  if(axolotl_box_open(\u0026bob_ctx, out2, \u0026outlen2, out, outlen)!=0) {\n    // fail\n    printf(\"fail :/\\n\");\n    exit(1);\n  }\n  printf(\"%d %s\\n\", outlen2, out2);\n}\n#+END_EXAMPLE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstef%2Flibsaxolotl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstef%2Flibsaxolotl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstef%2Flibsaxolotl/lists"}