Logo

0x5a.live

for different kinds of informations and explorations.

GitHub - trapped/elixir-rsa: Erlang public_key cryptography wrapper for Elixir

Erlang public_key cryptography wrapper for Elixir. Contribute to trapped/elixir-rsa development by creating an account on GitHub.

Visit SiteGitHub - trapped/elixir-rsa: Erlang public_key cryptography wrapper for Elixir

GitHub - trapped/elixir-rsa: Erlang public_key cryptography wrapper for Elixir

Erlang public_key cryptography wrapper for Elixir. Contribute to trapped/elixir-rsa development by creating an account on GitHub.

Powered by 0x5a.live ๐Ÿ’—

Easy RSA encryption/decryption in Elixir

This module wraps Erlang's public_key module, making RSA encryption/decryption a trivial task.

# Decode your public and private keys
public_key = RSA.decode_key "-----BEGIN RSA PUBLIC KEY----- ..."
private_key = ...

# Encrypt a string using the public key and decrypt it using the private key
plaintext = "hello world"
cyphertext = plaintext |> RSA.encrypt {:public, public_key}
# << ... encrypted binary data ... >>
# Encode it to base64
encrypted_b64 = :base64.encode_to_string cyphertext
# "... base64 ASCII text ..."

# Decode a base64 encrypted string and decrypt it
cyphertext = :base64.decode encrypted_b64
plaintext = cyphertext |> RSA.decrypt {:private, private_key}
# "hello world"

Elixir Resources

are all listed below.

Resources

listed to get explored on!!

Made with โค๏ธ

to provide different kinds of informations and resources.