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.
Summary↑
decrypt(obscuretext) | Decrypt some obscure text that was generated by encrypt
|
decrypt(obscuretext, appname) | Decrypt some obscure text that was generated by encrypt
|
decrypt(obscuretext, secret, salt) | Take an encrypted string, and convert it back to plaintext, must use the same secret and salt
|
encrypt(plaintext) | Convert a plaintext string into an encrypted string, for example
|
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
|
encrypt(plaintext, secret, salt) | Convert a plaintext string into a decryptable string by providing a secret
|
is_decrypted(plaintext, encrypted) | Compare a plaintext string to it’s encrypted version to test if they match.
|
Functions
Decrypt some obscure text that was generated by encrypt
enc = Safetybox.encrypt("helloworld")
Safetybox.decrypt(env)
Decrypt some obscure text that was generated by encrypt
enc = Safetybox.encrypt("helloworld")
Safetybox.decrypt(env)
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")
Convert a plaintext string into an encrypted string, for example
Safetybox.encrypt("helloworld")
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")
Convert a plaintext string into a decryptable string by providing a secret
Safetybox.encrypt("helloworld","mysecretkey", "mysecretsalt")
Compare a plaintext string to it’s encrypted version to test if they match.
Safetybox.is_decrypted("helloworld", "dasdf!@#CASD")