{"id":13507692,"url":"https://github.com/rozap/exgpg","last_synced_at":"2025-03-30T09:33:00.604Z","repository":{"id":26198287,"uuid":"29644413","full_name":"rozap/exgpg","owner":"rozap","description":"gpg interface","archived":false,"fork":false,"pushed_at":"2018-08-29T22:26:06.000Z","size":262,"stargazers_count":19,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-01T07:33:12.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rozap.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}},"created_at":"2015-01-22T02:27:41.000Z","updated_at":"2024-09-27T14:25:54.000Z","dependencies_parsed_at":"2022-07-27T07:48:25.659Z","dependency_job_id":null,"html_url":"https://github.com/rozap/exgpg","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/rozap%2Fexgpg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozap%2Fexgpg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozap%2Fexgpg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozap%2Fexgpg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rozap","download_url":"https://codeload.github.com/rozap/exgpg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301963,"owners_count":20755512,"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-08-01T02:00:37.848Z","updated_at":"2025-03-30T09:33:00.311Z","avatar_url":"https://github.com/rozap.png","language":"Elixir","funding_links":[],"categories":["Frameworks and Libs","Cryptography"],"sub_categories":["Elixir"],"readme":"Exgpg\n=====\n\nUse gpg from elixir\n\n\n## Installation\n\nAdd this to your mixfile\n```elixir\n { :exgpg, \"~\u003e 0.0.3\" },\n```\n\nInstall [goon](https://github.com/alco/goon) and put it on your PATH.\nIf you can run `goon` and get a usage output, then porcelain and thereby exgpg will be able to use it. \n\n## Usage\n\n#### Symmetric \n\n```elixir\n#proc is a Porcelain.Process. The `out` key is a stream of gpg's output.\nproc = Exgpg.symmetric(\"test string\", [passphrase: \"hunter2\"])\n\n# this will be a binary of the encrypted \"test string\"\nencrypted = Enum.into(proc.out, \"\") \n\nproc = Exgpg.decrypt(encrypted, [passphrase: \"hunter2\"])\n\n#put the decrypt stream into a string\nEnum.into(proc.out, \"\") # this will be \"test string\"\n```\n\n\n#### Asymmetric\n```elixir\n\n#proc is a Porcelain.Process. The `out` key is a stream of gpg's output. this\n#method allows for direct piping..\ndefp output(proc), do: proc.out\n\nout = \"hello world\"\n|\u003e Exgpg.encrypt([{:recipient, \"alice@alice.com\"}, {keyring: \"alice.pub\"}])\n|\u003e output\n|\u003e Exgpg.decrypt([secret_keyring: \"alice.sec\", keyring: \"alice.pub\"])\n|\u003e output\n|\u003e Enum.into(\"\")\n\nIO.puts out # this will print \"hello world\"\n\n```\n\n#### Generate a keypair\n```elixir\n{:ok, proc} = Exgpg.gen_key(\n      [\n        key_type: \"DSA\",\n        key_length: \"1024\",\n        subkey_type: \"ELG-E\",\n        subkey_length: \"1024\",\n        name_real: \"alice\",\n        name_email: \"alice@alice.com\",\n        expire_date: \"0\",\n        ctrl_pubring: \"alice.pub\", #pub ring will be written to alice.pub\n        ctrl_secring: \"alice.sec\", #sec ring will be written to alice.sec\n        ctrl_commit: \"\",\n        ctrl_echo: \"done\"\n      ]\n    )\n\nproc.status #will give the status code\nproc.err #will give an error description, if one occurred\n```\n\nOptions are passed directly to `gpg`, with a transformation to change the the `key_with_underscore` keylist convention in elixir to the `--key-with-dashes`. Most options should Just Work™.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozap%2Fexgpg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frozap%2Fexgpg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozap%2Fexgpg/lists"}