{"id":31780714,"url":"https://github.com/malwaredb/tlsh_pg","last_synced_at":"2025-10-10T08:18:23.692Z","repository":{"id":80634750,"uuid":"293637779","full_name":"malwaredb/tlsh_pg","owner":"malwaredb","description":"Postgres extension for the Trend Micro Locality Sensitive Hash","archived":false,"fork":false,"pushed_at":"2025-02-13T03:57:38.000Z","size":10,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T04:28:55.725Z","etag":null,"topics":["malware-research","postgresql","tlsh"],"latest_commit_sha":null,"homepage":"","language":"CMake","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/malwaredb.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-07T21:40:10.000Z","updated_at":"2025-02-13T03:57:41.000Z","dependencies_parsed_at":"2023-07-28T06:16:34.506Z","dependency_job_id":null,"html_url":"https://github.com/malwaredb/tlsh_pg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/malwaredb/tlsh_pg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwaredb%2Ftlsh_pg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwaredb%2Ftlsh_pg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwaredb%2Ftlsh_pg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwaredb%2Ftlsh_pg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malwaredb","download_url":"https://codeload.github.com/malwaredb/tlsh_pg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malwaredb%2Ftlsh_pg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003301,"owners_count":26083555,"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-10-10T02:00:06.843Z","response_time":62,"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":["malware-research","postgresql","tlsh"],"created_at":"2025-10-10T08:18:21.908Z","updated_at":"2025-10-10T08:18:23.686Z","avatar_url":"https://github.com/malwaredb.png","language":"CMake","funding_links":[],"categories":[],"sub_categories":[],"readme":"#### TLSH_PG\nThis project adds an extension to the [Postgres](https://www.postgresql.org/) database server to allow querying data by TLSH similarity. TLSH is the [Trend Micro Locality Sensitive Hash](https://github.com/trendmicro/tlsh).\n\n#### Compiling:\n1. Install pre-requisites: CMake, Postgres server dev packages. On Ubuntu/Debian, this can be done by running `sudo apt-get install cmake postgresql-server-dev-12` where 12 indicates the version of Postgres you're using.\n2. `git clone --recursive https://github.com/malwaredb/tlsh_pg.git`\n3. `cd tlsh_pg`\n4. Build TLSH, since it generates a needed header file.\n    1. `cd tlsh`\n    2. `./make.sh`\n5. `mkdir build`\n6. `cd build`\n7. `cmake .. -DCMAKE_BUILD_TYPE=Release`\n8. `make`\n9. Installation \u0026 testing:\n   1. Copy the resulting library to the Postgres `lib` directory, which is shown by running `pg_config --pkglibdir`.\n   2. As the Postgres user, run `psql DBNAME`, where you'll load the libary for the database schema you wish to use it with. This is done per-schema, as a privileged user.\n   3. At the psql prompt, run `CREATE OR REPLACE FUNCTION tlsh_compare(TEXT, TEXT) RETURNS INTEGER AS 'tlsh_psql.so', 'pg_tlsh_compare' LANGUAGE 'c';`.\n   4. Test by running `select tlsh_compare('T14814B643D364FEBFD624EAF8998AB8D5D4A5B0022BF00E5B65420EB704CE9D067543ED','T18784FA0392966E7FC9D6EFF8168BA4E5D562FC504BF0093B75404E3518CA9D0AB393E8');`. The result should be 233.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalwaredb%2Ftlsh_pg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalwaredb%2Ftlsh_pg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalwaredb%2Ftlsh_pg/lists"}