Popularity
4.9
Stable
Activity
0.0
Stable
35
2
13
Monthly Downloads: 2,036
Programming language: Elixir
License: MIT License
Tags:
Cryptography
rsa_ex alternatives and similar packages
Based on the "Cryptography" category.
Alternatively, view rsa_ex alternatives based on common mentions on social networks and blogs.
-
comeonin
Password hashing specification for the Elixir programming language -
nimble_totp
A tiny Elixir library for time-based one time passwords (TOTP) -
pot
POT is an Erlang library for generating Google Authenticator compatible one time passwords -
one_time_pass_ecto
No longer maintained - One-time password library with Ecto support (for Elixir) -
siphash-elixir
An Elixir implementation of the SipHash cryptographic hash family -
ntru_elixir
Elixir wrapper around libntru. NTRU is a post quantum cryptography algorithm. -
crypto_rsassa_pss
RSASSA-PSS Public Key Cryptographic Signature Algorithm for Erlang and Elixir. -
ex_bcrypt
Elixir wrapper for the OpenBSD bcrypt password hashing algorithm
Elixir and Phoenix Application Security Platform
Replace Snyk, reCaptcha, and Cloudflare bot defense with the only application security platform built for Elixir and Phoenix.
Promo
paraxial.io
Do you think we are missing an alternative of rsa_ex or a related project?
Popular Comparisons
README
RSA Ex
Library for working with RSA keys using Elixir and OpenSSL ports.
Installation
If available in Hex, the package can be installed as:
- Add
rsa_ex
to your list of dependencies inmix.exs
:
def deps do
[{:rsa_ex, "~> 0.4"}]
end
- Ensure
rsa_ex
is started before your application:
def application do
[applications: [:rsa_ex]]
end
Usage
- Generate RSA 2048 Private Key
iex> {:ok, priv} = RsaEx.generate_private_key
- Generate RSA 2048 Public Key
iex> {:ok, priv} = RsaEx.generate_private_key
iex> {:ok, pub} = RsaEx.generate_public_key(priv)
- Generate RSA 4096 Public Key
iex> {:ok, priv} = RsaEx.generate_private_key("4096")
iex> {:ok, pub} = RsaEx.generate_public_key(priv)
- Generate RSA 2048 Private/Public Keypair
iex> {:ok, {priv, pub}} = RsaEx.generate_keypair
- Generate RSA 4096 Private/Public Keypair
iex> {:ok, {priv, pub}} = RsaEx.generate_keypair("4096")
- Sign message with RSA private key
iex> {:ok, rsa_private_key} = RsaEx.generate_private_key
iex> {:ok, signature} = RsaEx.sign("message", rsa_private_key)
- Sign message with RSA private key specifying a custom dygest type
iex> {:ok, rsa_private_key} = RsaEx.generate_private_key
iex> {:ok, signature} = RsaEx.sign("message", rsa_private_key, :sha512)
- Verify signature with RSA public key
iex> {:ok, valid} = RsaEx.verify(message, signature, rsa_public_key)
- Verify signature with RSA public key specifying a custom dygest type
iex> {:ok, valid} = RsaEx.verify(message, signature, rsa_public_key, :sha512)
- Encrypt message with RSA public key in base64
iex> clear_text = "Important message"
"Important message"
iex> {:ok, cipher_text} = RsaEx.encrypt(clear_text, {:public_key, rsa_public_key})
{:ok, "Lmbv...HQ=="}
- Encrypt message with RSA private key in base64
iex> clear_text = "Important message"
"Important message"
iex> {:ok, cipher_text} = RsaEx.encrypt(clear_text, {:private_key, rsa_private_key})
{:ok, "Lmbv...HQ=="}
- Decrypt message with RSA private key
iex> {:ok, decrypted_clear_text} = RsaEx.decrypt(cipher_text, {:private_key, rsa_private_key})
{:ok, "Important message"}
- Decrypt message with RSA public key
iex> {:ok, decrypted_clear_text} = RsaEx.decrypt(cipher_text, {:public_key, rsa_public_key})
{:ok, "Important message"}