{"id":19745516,"url":"https://github.com/cossacklabs/pg_themis","last_synced_at":"2025-04-30T07:34:25.845Z","repository":{"id":78995366,"uuid":"72527524","full_name":"cossacklabs/pg_themis","owner":"cossacklabs","description":"Postgres Themis plugin","archived":false,"fork":false,"pushed_at":"2016-12-12T16:07:59.000Z","size":14,"stargazers_count":30,"open_issues_count":1,"forks_count":5,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-07-20T03:47:41.069Z","etag":null,"topics":["cryptography","encrypted-data","encryption","postgresql"],"latest_commit_sha":null,"homepage":"https://www.cossacklabs.com/themis/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cossacklabs.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}},"created_at":"2016-11-01T10:48:08.000Z","updated_at":"2023-03-06T11:49:22.000Z","dependencies_parsed_at":"2024-01-18T09:04:36.289Z","dependency_job_id":"e8fdddba-ed76-407d-828d-825da92caa8e","html_url":"https://github.com/cossacklabs/pg_themis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cossacklabs%2Fpg_themis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cossacklabs%2Fpg_themis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cossacklabs%2Fpg_themis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cossacklabs%2Fpg_themis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cossacklabs","download_url":"https://codeload.github.com/cossacklabs/pg_themis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224202862,"owners_count":17272807,"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":["cryptography","encrypted-data","encryption","postgresql"],"created_at":"2024-11-12T02:09:20.449Z","updated_at":"2024-11-12T02:09:21.139Z","avatar_url":"https://github.com/cossacklabs.png","language":"C","funding_links":[],"categories":["Compiled list","Extensions"],"sub_categories":["plv8:"],"readme":"# PG_Themis\nPostgres Themis plugin\n\n=======\n\npg_themis is a PostgreSQL extension for encrypting/decrypting data using the [Themis](https://github.com/cossacklabs/themis)  library. Requires PostgreSQL version 9.1 or later.\n\n## Building and installing PG_Themis\n\nRequirements:\nto build and install PG_Themis [themis](https://github.com/cossacklabs/themis) must be installed to sysytem\n\nTo build and install PG_Themis:\n\n```\nmake\nmake install\n```\n\nOnce PG_Themis is installed, you can add it to a database:\n\n```\nCREATE EXTENSION pg_themis;\n```\n\n## PG_Themis functions\n\nThe extension adds four functions `pg_themis_scell_encrypt_seal`, `pg_themis_scell_decrypt_seal`, `pg_themis_smessage_encrypt`, `pg_themis_smessage_decrypt`, which expose encryption decryption of [Secure Cell](https://github.com/cossacklabs/themis/wiki/Secure-Cell-cryptosystem) in Seal mode and [Secure Cell](https://github.com/cossacklabs/themis/wiki/Secure-Cell-cryptosystem) wrapped in [Secure Message](https://github.com/cossacklabs/themis/wiki/Secure-Message-cryptosystem) with random public key: \n\n```SQL\n-- Encrypts data with key.\nCREATE FUNCTION pg_themis_scell_encrypt_seal(data bytea, key bytea)\n    RETURNS bytea\n    AS 'pg_themis', 'pg_themis_scell_encrypt_seal' LANGUAGE c STRICT;\n\n-- Decrypts data with key.\nCREATE FUNCTION pg_themis_scell_decrypt_seal(encrypted_data bytea, key bytea)\n    RETURNS bytea\n    AS 'pg_themis', 'pg_themis_scell_decrypt_seal' LANGUAGE c STRICT;\n\n\n-- Encrypts data with public key.\nCREATE FUNCTION pg_themis_smessage_encrypt(plain_data bytea, public_key bytea)\n    RETURNS bytea\n    AS 'pg_themis', 'pg_themis_smessage_encrypt' LANGUAGE c STRICT;\n\n-- Decrypts data with private_key.\nCREATE FUNCTION pg_themis_smessage_decrypt(encrypted_data bytea, private_key bytea)\n    RETURNS bytea\n    AS 'pg_themis', 'pg_themis_smessage_decrypt' LANGUAGE c STRICT;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcossacklabs%2Fpg_themis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcossacklabs%2Fpg_themis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcossacklabs%2Fpg_themis/lists"}