{"id":18043514,"url":"https://github.com/fumiama/simple-dict","last_synced_at":"2025-04-09T22:11:32.127Z","repository":{"id":105114092,"uuid":"338977516","full_name":"fumiama/simple-dict","owner":"fumiama","description":"db[\"key\"]=\"value\" with tea encryption","archived":false,"fork":false,"pushed_at":"2023-11-08T09:13:15.000Z","size":297,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T22:11:24.564Z","etag":null,"topics":["c","crypto-operations","encryption","encryption-decryption","kv","kv-storage","kv-store","socket","socket-client","socket-io","socket-programming","socket-server","socketio","tea-encryption"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fumiama.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}},"created_at":"2021-02-15T05:35:16.000Z","updated_at":"2023-01-22T08:03:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"46f934bd-399e-437f-9448-c3a59315b6e9","html_url":"https://github.com/fumiama/simple-dict","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumiama%2Fsimple-dict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumiama%2Fsimple-dict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumiama%2Fsimple-dict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fumiama%2Fsimple-dict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fumiama","download_url":"https://codeload.github.com/fumiama/simple-dict/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119294,"owners_count":21050755,"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":["c","crypto-operations","encryption","encryption-decryption","kv","kv-storage","kv-store","socket","socket-client","socket-io","socket-programming","socket-server","socketio","tea-encryption"],"created_at":"2024-10-30T17:08:53.886Z","updated_at":"2025-04-09T22:11:32.106Z","avatar_url":"https://github.com/fumiama.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-dict\r\ndatabase[\"key\"]=\"value\" with tea encryption.\r\n\r\n## Prepare\r\nInstall [simple-crypto](https://github.com/fumiama/simple-crypto) and [simple-protobuf](https://github.com/fumiama/simple-protobuf) into `/usr/local` according to their README.\r\n\r\n## Compile\r\nClone this project into a system with cmake \u0026 libpthread installed.\r\nIf you plan to compile it on Windows, you ought to edit the source code and transform socket/thread/file libraries into a Windows version.\r\n```bash\r\ngit clone https://github.com/fumiama/simple-dict-server.git\r\n```\r\nCreate a `build` folder.\r\n```bash\r\ncd simple-dict-server\r\nmkdir build\r\n```\r\nUse `cmake` command to generate files for `make` automatically.\r\n```bash\r\ncd build\r\ncmake ..\r\n```\r\nUse `make` to generate executable binary files named `simple-dict-server` and `simple-dict-client` in `./build` directory.\r\n```bash\r\nmake\r\n```\r\nOptional: Use `make install` to install `simple-dict-server` into `/usr/local/bin`.\r\n\r\n## Execute\r\nStart server on localhost using the commands below.\r\n```bash\r\nchmod +x simple-dict-server simple-dict-client\r\nUsage:\r\n./simple-dict-server [-d] listen_port dict_file [ config_file | - ]\r\n        -d: As daemon\r\n        - : Read config from env SDS_PWD \u0026 SDS_SPS\r\n```\r\n`cfg.sp`is generated by `cfgwriter`, otherwise you can pass config by setting env `SDS_PWD` and `SDS_SPS`.\r\n\r\nOpen another shell to connect to it.\r\n```bash\r\n./simple-dict-client 127.0.0.1 7777\r\n```\r\nNow you have connected to the server. The default access passwords is in `client.c` and you can modify the password in source code as you like. Please note that the server will only wait `4` seconds for a response after the last communication. You can go to `server.h` to edit this limit. The box below shows how to control the server to accompilsh basic add/del/find/edit operations.\r\n\r\n|  cmd  |  data  |  description  |  reply  |\r\n|  ----  | ----  | ----  | ----- |\r\n| get:  | key | get key value | the value or \"null\" |\r\n| cat:  | filename | save raw dict.sp into filename | the raw data |\r\n| md5:  | md5 str | compare whether md5 of dict.sp is what given in data | \"nequ\" or \"null\" |\r\n| end   | no data  | end conversation | no reply |\r\n| set:  | key | set key | \"data\" |\r\n| dat:  | value to set | give value to the key | \"succ\" |\r\n| del:  | key | del key | \"succ\" or \"null |\r\n\r\n- The raw data starts with an integer showing its size, then a char `$` follows, finally following all binary data in `./dict.sp` encoded by `TEA`.\r\n- Whenever the reply is \"erro\", it indicates that the server has some troubles, which means that you shuold end the conversation and retry later.\r\n\r\nA cmd sequence example is as below\r\n\r\nhttps://user-images.githubusercontent.com/41315874/167127391-1798f7ec-f917-4246-b31f-258db9dc771e.mp4\r\n\r\n## Android Client for simple-dict-server\r\nThere is also an [Android Client](https://github.com/fumiama/simple-dict-android) for simple-dict-server. Just install the apk file downloaded from release page and click `config` icon to set your server address using the format\r\n```\r\n127.0.0.1:7777_password^superpassword\r\n```\r\nNote that this APP is designed for a new language called `Tenenja`, so the font inside is abnormal. What's more, there is no English translation for this APP because its users are Chinese. If you want to get an APP in your language, just edit the source code for free.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumiama%2Fsimple-dict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffumiama%2Fsimple-dict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffumiama%2Fsimple-dict/lists"}