ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - rozap/exgpg: gpg interface
gpg interface. Contribute to rozap/exgpg development by creating an account on GitHub.
Visit Site

GitHub - rozap/exgpg: gpg interface

GitHub - rozap/exgpg: gpg interface

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™.

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory