{"id":20216781,"url":"https://github.com/fractal-code/mylar-search","last_synced_at":"2025-07-30T11:06:41.508Z","repository":{"id":21233708,"uuid":"24549006","full_name":"fractal-code/mylar-search","owner":"fractal-code","description":"Mylar, multi-key search over encrypted data","archived":false,"fork":false,"pushed_at":"2014-11-11T03:08:06.000Z","size":1090,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T15:45:01.894Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"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/fractal-code.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2014-09-28T03:22:08.000Z","updated_at":"2024-06-25T01:41:03.000Z","dependencies_parsed_at":"2022-09-09T05:10:46.258Z","dependency_job_id":null,"html_url":"https://github.com/fractal-code/mylar-search","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/fractal-code/mylar-search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractal-code%2Fmylar-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractal-code%2Fmylar-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractal-code%2Fmylar-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractal-code%2Fmylar-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fractal-code","download_url":"https://codeload.github.com/fractal-code/mylar-search/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fractal-code%2Fmylar-search/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267858035,"owners_count":24155916,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-14T06:29:43.986Z","updated_at":"2025-07-30T11:06:41.464Z","avatar_url":"https://github.com/fractal-code.png","language":"JavaScript","readme":"# mylar:search\n\nThe Mylar platform features a multi-key search system that enables keyword search over data encrypted with different keys. This is crucial for enabling collaboration between users and other traditional functionality in web applications.\n\n(More information about the system is available [here](http://eprint.iacr.org/2013/508.pdf)).\n\nThis meteor packages extends the core functionality of [Mylar](https://github.com/gliesesoftware/mylar).\n\n## Installation\nEnsure you have the [mylar:platform package](https://github.com/gliesesoftware/mylar) or an equivalent set of packages added to your app.\n\n```console\nmeteor add mylar:platform\n```\n\nEnsure you have the following libraries to build the crypto server:\u003cbr\u003e\n\n- libreadline\n- libgmp\n- libpbc\n- libcrypto++9\n\nAdd the mylar:search package to your app\n\n```console\nmeteor add mylar:search\n```\n## Usage\u003cbr\u003e\n1. Add 'SEARCHABLE' attribute to your encrypted fields annotations. \u003cbr\u003e\n```javascript\n// make the encrypted 'messages' field in Collection 'Messages' searchable\nMessages._encrypted_fields({'message': {princ: 'roomprinc', \n                                           princtype: 'room', \n                                           auth: ['_id', 'foo'],\n                                           attr: 'SEARCHABLE'}});\n```\n\u003cbr\u003e\n2. Publish a search filter on the server\n```javascript\n// publishes filter for \"Messages\" Collection named \"messages-user-can-access\"\n// takes in an argument \"userID\" to identify the rooms user has access to\n// returns an array of room ID's to check against each message\nMessages.publish_search_filter(\"messages-user-can-access\", function (userID) {\n\t// create a list of all the rooms this user has access to\n\tvar rooms = Rooms.find({$or: [{createdByID: userID},\n\t\t\t\t           {invitedID : userID}]}).fetch();\n\tvar filters = [];\n\t_.each(rooms, function(room) {\n\t    filters.push({rID: room._id});\n\t});\n\t\n\treturn filters;\n    };\n});\n```\n\u003cbr\u003e\n3. Search for words in fields of a collection using a filter\n```javascript\n// search for word 'foo' in field 'message' using filter 'blue-colored'\n// use logged in user's principal \u0026 pass in 'filterInput' to search filter\n// log search result in callback\nMessages.search(\"blue-colored\", {'message': 'foo'}, Principal.user(), 'filterInput', function (result) {console.log(\"Search result: \" + result);});\n```\n\u003cbr\u003e\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffractal-code%2Fmylar-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffractal-code%2Fmylar-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffractal-code%2Fmylar-search/lists"}