Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xrstf/boxer
NaCl in Go for humans
https://github.com/xrstf/boxer
Last synced: 17 days ago
JSON representation
NaCl in Go for humans
- Host: GitHub
- URL: https://github.com/xrstf/boxer
- Owner: xrstf
- Created: 2015-10-11T01:05:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-11T19:26:11.000Z (about 9 years ago)
- Last Synced: 2024-12-17T13:52:22.785Z (22 days ago)
- Language: Go
- Size: 133 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Boxer - NaCl for Humans
=======================
[![Build Status](https://travis-ci.org/xrstf/boxer.svg?branch=master)](https://travis-ci.org/xrstf/boxer)
[![GoDoc](https://godoc.org/github.com/xrstf/boxer?status.svg)](https://godoc.org/github.com/xrstf/boxer)This Go package implements a convenience wrapper around the NaCl package.
Its main goal is to hide the management of nonces and salts from the user.
Passwords will be automatically stretched using scrypt, the nonce includes
the current time to make collisions less likely.Note that the key stretching is performed on each encryption/decryption, so
if you plan to perform a lot of crypto operations in a short time, this might
be too expensive.Disclaimer
----------I am by no means a cryptography expert. Do not blindly trust this code, read
it and judge by yourself. If you find a flaw, please open an issue and tell me.On that note: This package is *very* opinionated. It solves a very narrow
usecase and should not be applied to every problem that sounds like "I need
to encrypt stuff". It also serves as a demonstration on how to use the NaCl
library.Installation
------------```
go get github.com/xrstf/boxer
```Usage
-----```go
dataToEncrypt := "I am something to keep secret."
password := "sup3r s3cur3"// create a Boxer with default scrypt settings
bxr := boxer.NewDefaultBoxer()// encrypt
ciphertext, err := bxr.Encrypt([]byte(dataToEncrypt), []byte(password))
if err != nil {
panic(err)
}// and decrypt again
plaintext, err := bxr.Decrypt(ciphertext, []byte(password))
if err != nil {
panic(err)
}fmt.Println(plaintext)
```License
-------This code is licensed under the MIT license.