Documentation ¶
Overview ¶
Package triplesec implements the TripleSec v3 and v4 encryption and authentication scheme.
For details on TripleSec, go to https://keybase.io/triplesec/
Index ¶
Constants ¶
const AESIVLen = 16
const CipherKeyLen = 32
const MacKeyLen = 48
const MacOutputLen = 64
const SalsaIVLen = 24
const SaltLen = 16
const TwofishIVLen = 16
const VersionBytesLen = 4
Variables ¶
var MagicBytes = [4]byte{0x1c, 0x94, 0xd7, 0xde}
MagicBytes are the four bytes prefixed to every TripleSec ciphertext, 1c 94 d7 de.
Functions ¶
This section is empty.
Types ¶
type BadPassphraseError ¶
type BadPassphraseError struct{}
func (BadPassphraseError) Error ¶
func (e BadPassphraseError) Error() string
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
func NewCipher ¶
NewCipher makes an instance of TripleSec using a particular key and a particular salt
func NewCipherWithRng ¶
func NewCipherWithRng(passphrase []byte, salt []byte, version Version, rng RandomnessGenerator) (*Cipher, error)
NewCipherWithRng makes an instance of TripleSec using a particular key and a particular salt and uses a given randomness stream
func (*Cipher) Decrypt ¶
Decrypt decrypts a TripleSec ciphertext using the Cipher passphrase. The dst buffer size must be at least len(src) - Overhead. dst and src can not overlap. src is left untouched.
Encrypt returns a error if the ciphertext is not recognized, if authentication fails or on memory failures.
type CorruptionError ¶
type CorruptionError struct {
// contains filtered or unexported fields
}
func (CorruptionError) Error ¶
func (e CorruptionError) Error() string
type CryptoRandGenerator ¶
type CryptoRandGenerator struct{}
func NewCryptoRandGenerator ¶
func NewCryptoRandGenerator() CryptoRandGenerator
type RandomTapeGenerator ¶
type RandomTapeGenerator struct {
// contains filtered or unexported fields
}
func NewRandomTapeGenerator ¶
func NewRandomTapeGenerator(randomTape []byte) RandomTapeGenerator
type RandomnessGenerator ¶
type VersionError ¶
type VersionError struct {
// contains filtered or unexported fields
}
func (VersionError) Error ¶
func (e VersionError) Error() string