Packages

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

Current section

Files

Jump to
fernet_passphrase lib mix tasks decrypt.ex
Raw

lib/mix/tasks/decrypt.ex

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