Packages

A package to encrypt and decrypt a string based on a passphrase.

Current section

Files

Jump to
fernet_passphrase lib mix tasks encrypt.ex
Raw

lib/mix/tasks/encrypt.ex

defmodule Mix.Tasks.Encrypt do
use Mix.Task
@impl Mix.Task
def run([passphrase, plaintext]) do
{:ok, ciphertext} = Fernet.Passphrase.encrypt(passphrase, plaintext)
IO.puts(ciphertext |> Base.encode64())
end
end