https://github.com/dwin/go-triplesec
A fork of keybase's fork of Fillipo's TripleSec
https://github.com/dwin/go-triplesec
Last synced: 5 months ago
JSON representation
A fork of keybase's fork of Fillipo's TripleSec
- Host: GitHub
- URL: https://github.com/dwin/go-triplesec
- Owner: dwin
- License: mit
- Fork: true (keybase/go-triplesec)
- Created: 2017-01-10T00:04:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T16:40:22.000Z (almost 9 years ago)
- Last Synced: 2026-01-05T23:20:06.768Z (5 months ago)
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TripleSec
---
Golang implementation of the layered encryption scheme TripleSec
A fork of Fillipo's TripleSec
See [TripleSec Homepage](https://keybase.io/triplesec/) for more info.
---
## Installation
go get github.com/keybase/go-triplesec
## Usage
import "github.com/keybase/go-triplesec"
### Example
```go
package main
import (
"crypto/rand"
"fmt"
"github.com/keybase/go-triplesec"
"log"
)
func main() {
// Make Random 16 byte salt
passphrase := []byte("password1234567890")
salt := make([]byte, 16)
_, err := rand.Read(salt)
if err != nil {
log.Fatal("Could not create random salt")
}
// Create Cipher
cipher, err := triplesec.NewCipher(passphrase, salt)
if err != nil {
log.Fatal("Error creating new triple sec cipher")
}
fileBytes := []byte("testdata")
encryptedFileBytes, err := cipher.Encrypt(fileBytes)
if err != nil {
log.Fatal("Encryption error")
}
// Do something with encrypted data such as save the file/send to remote
}
```