Product Promotion
0x5a.live
for different kinds of informations and explorations.
GitHub - rozap/exgpg: gpg interface
gpg interface. Contribute to rozap/exgpg development by creating an account on GitHub.
Visit SiteGitHub - rozap/exgpg: gpg interface
gpg interface. Contribute to rozap/exgpg development by creating an account on GitHub.
Powered by 0x5a.live 💗
Exgpg
Use gpg from elixir
Installation
Add this to your mixfile
{ :exgpg, "~> 0.0.3" },
Install goon and put it on your PATH.
If you can run goon
and get a usage output, then porcelain and thereby exgpg will be able to use it.
Usage
Symmetric
#proc is a Porcelain.Process. The `out` key is a stream of gpg's output.
proc = Exgpg.symmetric("test string", [passphrase: "hunter2"])
# this will be a binary of the encrypted "test string"
encrypted = Enum.into(proc.out, "")
proc = Exgpg.decrypt(encrypted, [passphrase: "hunter2"])
#put the decrypt stream into a string
Enum.into(proc.out, "") # this will be "test string"
Asymmetric
#proc is a Porcelain.Process. The `out` key is a stream of gpg's output. this
#method allows for direct piping..
defp output(proc), do: proc.out
out = "hello world"
|> Exgpg.encrypt([{:recipient, "[email protected]"}, {keyring: "alice.pub"}])
|> output
|> Exgpg.decrypt([secret_keyring: "alice.sec", keyring: "alice.pub"])
|> output
|> Enum.into("")
IO.puts out # this will print "hello world"
Generate a keypair
{:ok, proc} = Exgpg.gen_key(
[
key_type: "DSA",
key_length: "1024",
subkey_type: "ELG-E",
subkey_length: "1024",
name_real: "alice",
name_email: "[email protected]",
expire_date: "0",
ctrl_pubring: "alice.pub", #pub ring will be written to alice.pub
ctrl_secring: "alice.sec", #sec ring will be written to alice.sec
ctrl_commit: "",
ctrl_echo: "done"
]
)
proc.status #will give the status code
proc.err #will give an error description, if one occurred
Options 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™.
Elixir Resources
are all listed below.
GitHub - hamiltop/structurez: A playground for data structures in Elixir
resource
~/github.com
resource
GitHub - noizu-labs-ml/elixir-weaviate: Weaviate Rest Wrapper for Elixir
resource
~/github.com
resource
GitHub - elpassion/sprint-poker: Online estimation tool for Agile teams.
resource
~/github.com
resource
GitHub - jarednorman/canada: Easy permission definitions in Elixir apps!
resource
~/github.com
resource
GitHub - yesmeck/hexdocset: Convert hex doc to Dash.app's docset format.
resource
~/github.com
resource
GitHub - fuelen/owl: A toolkit for writing command-line user interfaces.
resource
~/github.com
resource
GitHub - dashbitco/flow: Computational parallel flows on top of GenStage
resource
~/github.com
resource
GitHub - ueberauth/ueberauth_github: GitHub OAuth2 Strategy for Überauth
resource
~/github.com
resource
GitHub - pragmaticivan/logglix: 🎱 Logger backend app for Loggly requests
resource
~/github.com
resource
GitHub - jfrolich/smoothie: Beautiful emails for your elixir application
resource
~/github.com
resource
GitHub - mmmries/chunky_svg: An Elixir library for generating SVG images
resource
~/github.com
resource
GitHub - jsonmaur/phoenix-turnstile: Use Cloudflare Turnstile in Phoenix
resource
~/github.com
resource
GitHub - elixirstatus/phoenix_html_sanitizer: HTML Sanitizer for Phoenix
resource
~/github.com
resource
GitHub - meh/cauldron: I wonder what kind of Elixir is boiling in there.
resource
~/github.com
resource
GitHub - narrowtux/Tube: WebSocket client library written in pure Elixir
resource
~/github.com
resource
GitHub - Arp-G/pictionary: Picture guessing and drawing multiplayer game
resource
~/github.com
resource
GitHub - camshaft/world_json_ex: elixir module for the world in geo.json
resource
~/github.com
resource
GitHub - ikeikeikeike/exfavicon: Elixir library for discovering favicons
resource
~/github.com
resource
GitHub - kofigumbs/codec-beam: Generate Erlang VM byte code from Haskell
resource
~/github.com
resource
GitHub - gausby/bencode: A bencode encoder and decoder written in Elixir
resource
~/github.com
resource
GitHub - bradleyd/exgrid: Elixir library to interact with Sendgrid's API
resource
~/github.com
resource
GitHub - avitex/elixir-vultr: Simple wrapper for the Vultr API in Elixir
resource
~/github.com
resource
GitHub - mhinz/vim-mix-format: Vim integration for the Elixir formatter.
resource
~/github.com
resource
GitHub - 81dr/ex_changerate: Elixir client for exchangerate platform API
resource
~/github.com
resource
Made with ❤️
to provide different kinds of informations and resources.