{"id":22419665,"url":"https://github.com/sentclose/sentc-rust","last_synced_at":"2025-10-16T03:05:29.746Z","repository":{"id":166588467,"uuid":"642092573","full_name":"sentclose/sentc-rust","owner":"sentclose","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T22:26:29.000Z","size":257,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-26T08:31:52.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sentclose.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2023-05-17T20:01:25.000Z","updated_at":"2024-10-24T21:01:03.000Z","dependencies_parsed_at":"2023-11-15T00:25:37.818Z","dependency_job_id":"21b22a41-e2e5-4ac0-80c1-f8616d727525","html_url":"https://github.com/sentclose/sentc-rust","commit_stats":null,"previous_names":["sentclose/sentc-rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentclose%2Fsentc-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentclose%2Fsentc-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentclose%2Fsentc-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sentclose%2Fsentc-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sentclose","download_url":"https://codeload.github.com/sentclose/sentc-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228330057,"owners_count":17903019,"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-12-05T16:16:26.893Z","updated_at":"2025-10-07T17:13:56.708Z","avatar_url":"https://github.com/sentclose.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sentc sdk\n\nIt supports user- and group management as well as key rotation and its build to serve large amount of users without any\nproblems.\n\n## Why a new protocol?\n\n- focus on groups\n- focus on archive, encrypt once and everyone with access can decrypt it without expensive and complex key exchange\n- serverside encrypted key rotation. Much faster than client side rotation.\n\n## Sentc got two components:\n\n- the client sdks to encrypt and decrypt\n- the server to handle user auth and groups + key management\n\n### Difference between rust sdk and the other\n\nThe other sdk's like javascript or flutter are designed with datastore in mind.\nIn js it uses the indexeddb in the browser and in flutter the device storage or encrypted storage.\n\nThis sdk was designed to use your own storage. This means you need to provide more information for each function than in\nthe other sdk's.\nBut this gives you the flexibility to use it in your programs without compromises.\n\nThere is no init function anymore. You can just use the functions you need.\n\n## Usage\n\nIn all doc examples we are using the StdKeys implementation. You can switch it by changing the features and use other\nimplementation or even write your own.\n\n### Create an account and an app\n\nTo use the sdk, you need a public and secret token.\n\nThe public token will be used in your sdk at the frontend and the secret token should only be used at your backend.\nYou can set what function should be called with which token.\n\n1. Got to [https://api.sentc.com/dashboard/register](https://api.sentc.com/dashboard/register) and create an account.\n   You will be redirected to the account dashboard.\n2. Verify the email. We email you to make sure that your email address belongs to you.\n3. In your dashboard click on the blue button: New App. You will get the app tokens and the first jwt keys.\n\nNow you are ready to use the sdk.\n\n### Install the sdk.\n\nPlease choose an implementation of the algorithms. There are StdKeys, FIPS or Rec keys. The impl can not work together.\n\n- StdKeys (feature = std_keys) are a pure rust implementation of the algorithms. They can be used in the web with wasm\n  and on mobile.\n- FIPS keys (feature = fips_keys) are FIPS approved algorithms used from Openssl Fips. This impl does not support post\n  quantum.\n- Rec keys (feature = rec_keys) or recommended keys are a mix of FIPS keys for the classic algorithms and oqs (for post\n  quantum).\n\nThe net feature is necessary for the requests to the backend. The library reqwest is used to do it.\n\n```bash\ncargo add sentc\n```\n\n````rust\nuse sentc::keys::{StdUser, StdGroup};\n\nasync fn example()\n{\n\t//register a user\n\tlet user_id = StdUser::register(\"base_url\".to_string(), \"app_token\".to_string(), \"the-username\", \"the-password\").await.unwrap();\n\n\t//login a user, ignoring possible Multi-factor auth\n\tlet user = StdUser::login_forced(\"base_url\".to_string(), \"app_token\", \"username\", \"password\").await.unwrap();\n\n\t//create a group\n\tlet group_id = user.create_group().await.unwrap();\n\n\t//get a group. first check if there are any data that the user need before decrypting the group keys.\n\tlet (data, res) = user.prepare_get_group(\"group_id\", None).await.unwrap();\n\n\t//if no data then just decrypt the group keys\n\tassert!(matches!(res, GroupFetchResult::Ok));\n\n\tlet group = user.done_get_group(data, None).unwrap();\n\n\t//invite another user to the group. Not here in the example because we only got one user so far\n\tgroup.invite_auto(user.get_jwt().unwrap(), \"user_id_to_invite\", user_public_key, None).await.unwrap();\n\n\t//encrypt a string for the group\n\tlet encrypted = group.encrypt_string_sync(\"hello there!\").unwrap();\n\n\t//now every user in the group can decrypt the string\n\tlet decrypted = group.decrypt_string_sync(encrypted, None).unwrap();\n\n\t//delete a group\n\tgroup.delete_group(user.get_jwt().unwrap()).await.unwrap();\n\n\t//delete a user\n\tuser.delete(\"password\", None, None).await.unwrap();\n}\n````\n\n## Limitations\n\nThe protocol is designed for async long-running communication between groups.\n\n- A group member should be able to decrypt the whole communication even if they joined years after the beginning.\n- Group member should get decrypt all messages even if they were offline for years.\n\nThe both requirements make perfect forward secrecy impossible. See more at the Protocol how we solved it.\n\n## Contact\n\nIf you want to learn more, just contact me [contact@sentclose.com](mailto:contact@sentclose.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentclose%2Fsentc-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsentclose%2Fsentc-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsentclose%2Fsentc-rust/lists"}