Skip to content

A simple, opinionated library for encrypting small packets of data securely.

License

Notifications You must be signed in to change notification settings

camshaft/simple_secrets_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple_secrets_ex Build Status

The elixir implementation of a simple, opinionated library for encrypting small packets of data securely. Designed for exchanging tokens among systems written in a variety of programming languages:

Examples

Basic

Send:

# Try `head /dev/urandom | shasum -a 256` to make a decent 256-bit key
master_key = "64-char-hex"

sender = SimpleSecrets.init(master_key)
{:ok, packet} = SimpleSecrets.pack("this is a secret message", sender)

IO.inspect(packet)
# <<"bBDTl5NKdpvMfriRElbbOw0WEsENjbvv7mqK4"...>>

Receive:

master_key = "shared-key-hex"
sender = SimpleSecrets.init(master_key)

# Read data from somewhere
packet = <<"bBDTl5NKdpvMfriRElbbOw0WEsENjbvv7mqK4"...>>
{:ok, message} = SimpleSecrets.unpack(packet, sender)

IO.inspect(message)
# "this is a secret message"

Can you add ...

No. Seriously. But we might replace what we have with what you suggest. We want exactly one, well-worn path. If you have improvements, we want them. If you want alternatives to choose from you should probably keep looking.

License

MIT.

About

A simple, opinionated library for encrypting small packets of data securely.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages