All Projects → neatnik → salty

neatnik / salty

Licence: MIT license
Portable NaCl-powered encryption

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to salty

sodalite
tweetnacl in rust
Stars: ✭ 26 (+0%)
Mutual labels:  libsodium, nacl
dryoc
Don't Roll Your Own Crypto: pure-Rust, hard to misuse cryptography library
Stars: ✭ 163 (+526.92%)
Mutual labels:  libsodium, nacl
Flutter sodium
Flutter bindings for libsodium
Stars: ✭ 77 (+196.15%)
Mutual labels:  libsodium
libgodium
Pure Go implementation of cryptographic APIs found in libsodium
Stars: ✭ 46 (+76.92%)
Mutual labels:  libsodium
Enacl
Erlang bindings for NaCl / libsodium
Stars: ✭ 159 (+511.54%)
Mutual labels:  libsodium
Libsodium Go
A complete overhaul of the Golang wrapper for libsodium
Stars: ✭ 105 (+303.85%)
Mutual labels:  libsodium
Pgsodium
Modern cryptography for PostgreSQL using libsodium.
Stars: ✭ 202 (+676.92%)
Mutual labels:  libsodium
Tweetnacl Js
Port of TweetNaCl cryptographic library to JavaScript
Stars: ✭ 1,176 (+4423.08%)
Mutual labels:  libsodium
cloak
A simple passphrase based file encryption tool.
Stars: ✭ 12 (-53.85%)
Mutual labels:  nacl
Libsodium Jni
(Android) Networking and Cryptography Library (NaCL) JNI binding. JNI is utilized for fastest access to native code. Accessible either in Android or Java application. Uses SWIG to generate Java JNI bindings. SWIG definitions are extensible to other languages.
Stars: ✭ 157 (+503.85%)
Mutual labels:  libsodium
molch
An implementation of the axolotl ratchet based on libsodium.
Stars: ✭ 24 (-7.69%)
Mutual labels:  libsodium
Learntocrypto
Learn to crypto workshop
Stars: ✭ 1,687 (+6388.46%)
Mutual labels:  libsodium
Streamcryptor
Stream encryption & decryption with libsodium and protobuf
Stars: ✭ 112 (+330.77%)
Mutual labels:  libsodium
Nsec
A modern and easy-to-use cryptographic library for .NET Core based on libsodium
Stars: ✭ 217 (+734.62%)
Mutual labels:  libsodium
Chloride
Stars: ✭ 83 (+219.23%)
Mutual labels:  libsodium
soda
Libsodium bindings for Erlang
Stars: ✭ 17 (-34.62%)
Mutual labels:  libsodium
Zbox
Zero-details, privacy-focused in-app file system.
Stars: ✭ 1,185 (+4457.69%)
Mutual labels:  libsodium
Kalium
Java binding to the Networking and Cryptography (NaCl) library with the awesomeness of libsodium
Stars: ✭ 203 (+680.77%)
Mutual labels:  libsodium
libsalty
Elixir bindings for libsodium (NIF)
Stars: ✭ 20 (-23.08%)
Mutual labels:  libsodium
Encryptedrmd
🔑 Password protected markdown html reports in R using libsodium
Stars: ✭ 136 (+423.08%)
Mutual labels:  libsodium

Salty

Portable NaCl-powered encryption

Salty makes it easy to send strongly-encrypted messages with a shared key. It uses NaCl (via Libsodium) for encryption and basE91 for portability.

With Salty, you can encrypt a message as long as 185 characters and the resulting cipher will still fit in a tweet (~277 characters), making it ideal for encrypting tweets or other length-restricted communication. You can use it anywhere, though, with text of any length.

Demo

You can try it out at https://neatnik.net/salty/

Examples

Unencrypted payload: The quick brown fox jumped over the lazy sleeping dog.

Key: hunter2

Resulting Salty cipher:

-- BEGIN SALTY ENCRYPTED MESSAGE --
WZ {/ rf 4a aQ 8f tC WI c? VJ nK UQ 
>T 7W nj W7 rR r~ r& :. zY NJ sm k6 
`@ eq G5 Ty Tl uE %T uR AM D_ J~ "Y 
p+ q2 AM dN 0} ;H #v Ez L_ 9m }! X^ 
Ws `v %) >v ,_ ^] 70 ,+ hv TN
-- END SALTY ENCRYPTED MESSAGE --

(Note that the cipher will change with each encryption.)

The above cipher is identical to this shortened version:

RX.c:L6%xUa,Rhg>w%@]X+rl|a4{uPVRa.)
;&wSOD+_(kJ=bZ?&_|*z+se035=Dw*2Rl?(
H&0c{~5i@CT!V&m5O4&BHNcEL:%c5Tbsd9n
#8++h/*YsGP

Using the key above on either cipher will yield the same plaintext message. Salty’s shortened format is ideal for space-restricted contexts (e.g. Twitter), whereas the longer format works better in emails or other places where text might need to freely wrap.

Spec

Salty’s spec is uncomplicated:

  • Take a plaintext message and encrypt it via NaCl’s secret key authenticated encryption scheme “crypto_secretbox”.
  • Then take the resulting binary data and encode it in basE91. (Why basE91? It’s the most efficient base conversion around, making the most effective use of available ASCII characters.)
  • The resulting encoded cipher can be used as is, or wrapped in the BEGIN header and END footer, and spaces can be added to make the cipher wrap nicely in different places (e.g. email).
  • When decrypting a cipher, first remove any spaces or newline characters, as well as the optional BEGIN/END header/footer. The resulting basE91-decoded cipher is ready for decryption via NaCl, using the same key and salt used during encryption.

API

Salty comes with an uncomplicated API. Simply POST an action of either encrypt or decrypt, a payload of plaintext to be encrypted or a Salty cipher to be decrypted, and a key. The response will include an http_status code (200 for success, 400 for failure) and a response consisting of your encrypted/decrypted text (or an error message if the status code is 400).

Further Reading

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].