Safetybox

Safetybox a collection of security oriented functions

This is oriented towards individuals that store passwords

directly in their code, or some other not-so-hard-to-find location

Dependency

{ :safetybox, "~> 0.1" }

Usage

API

pwd = Safetybox.encrypt("helloworld")

Safetybox.is_decrypted("goodbyeworld", pwd) # > returns false
Safetybox.is_decrypted("helloworld", pwd) # > returns true

Author

Copyright © 2014 Andrew Forward @a4word, aforward@gmail.com Licensed under MIT.

Source

Summary

decrypt(obscuretext)

Decrypt some obscure text that was generated by encrypt

enc = Safetybox.encrypt("helloworld")
  Safetybox.decrypt(env)
decrypt(obscuretext, appname)

Decrypt some obscure text that was generated by encrypt

enc = Safetybox.encrypt("helloworld")
  Safetybox.decrypt(env)
decrypt(obscuretext, secret, salt)

Take an encrypted string, and convert it back to plaintext, must use the same secret and salt

enc = Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
  Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
encrypt(plaintext)

Convert a plaintext string into an encrypted string, for example

Safetybox.encrypt("helloworld")
encrypt(plaintext, appname)

One tiny secret for a developer, one giant leap in security. Pick a secret within your application (or ENV variable), to better prevent your strings being decrypted

Safetybox.encrypt("helloworld","mysecretkey")
encrypt(plaintext, secret, salt)

Convert a plaintext string into a decryptable string by providing a secret

Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
is_decrypted(plaintext, encrypted)

Compare a plaintext string to it’s encrypted version to test if they match.

Safetybox.is_decrypted("helloworld", "dasdf!@#CASD")

Functions

decrypt(obscuretext)

Decrypt some obscure text that was generated by encrypt

enc = Safetybox.encrypt("helloworld")
  Safetybox.decrypt(env)
Source
decrypt(obscuretext, appname)

Decrypt some obscure text that was generated by encrypt

enc = Safetybox.encrypt("helloworld")
  Safetybox.decrypt(env)
Source
decrypt(obscuretext, secret, salt)

Take an encrypted string, and convert it back to plaintext, must use the same secret and salt

enc = Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
  Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
Source
encrypt(plaintext)

Convert a plaintext string into an encrypted string, for example

Safetybox.encrypt("helloworld")
Source
encrypt(plaintext, appname)

One tiny secret for a developer, one giant leap in security. Pick a secret within your application (or ENV variable), to better prevent your strings being decrypted

Safetybox.encrypt("helloworld","mysecretkey")
Source
encrypt(plaintext, secret, salt)

Convert a plaintext string into a decryptable string by providing a secret

Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
Source
is_decrypted(plaintext, encrypted)

Compare a plaintext string to it’s encrypted version to test if they match.

Safetybox.is_decrypted("helloworld", "dasdf!@#CASD")
Source