Features
Symmetric Encryption
Password-based encryption using PGP symmetric cipher
Asymmetric Encryption
Public key encryption for identity management
OpenPGP Standard
Compatible with GPG and other OpenPGP implementations
Legacy Support
ToTrix/FromTrix for backwards compatibility
Installation
import "github.com/Snider/Borg/pkg/trix"
// Encrypt DataNode with PGP
encrypted, _ := trix.ToTrix(datanode, password)
// Key derivation
key := trix.DeriveKey(password) // SHA-256 hash, 32 bytes
Usage
Key Derivation
func DeriveKey(password string) []byte {
hash := sha256.Sum256([]byte(password))
return hash[:] // 32 bytes
}
Note: FromTrix with password returns error "decryption disabled" - this is intentional to prevent accidental password use on potentially malicious payloads.
Quick Links
More from Lethean R&D Labs
Fancy helping out?
Spotted a bug? Got an idea? We'd love to hear from you.
Read the contributing guide →