Documentation ¶
Overview ¶
Package triplesec implements the TripleSec v3 encryption and authentication scheme.
For details on TripleSec, go to https://keybase.io/triplesec/
Index ¶
Constants ¶
View Source
const MacOutputLen = 64
View Source
const SaltLen = 16
Variables ¶
View Source
var ( IVLen = 16 SalsaIVLen = 24 TotalIVLen = 2*IVLen + SalsaIVLen DkLen = 2*macKeyLen + 3*cipherKeyLen )
View Source
var MagicBytes = [4]byte{0x1c, 0x94, 0xd7, 0xde}
The MagicBytes are the four bytes prefixed to every TripleSec ciphertext, 1c 94 d7 de.
View Source
var Overhead = len(MagicBytes) + 4 + SaltLen + 2*MacOutputLen + TotalIVLen
Overhead is the amount of bytes added to a TripleSec ciphertext.
len(plaintext) + Overhead = len(ciphertext)
It consists of: magic bytes + version + salt + 2 * MACs + 3 * IVS.
View Source
var Version uint32 = 3
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 (*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 VersionError ¶
type VersionError struct {
// contains filtered or unexported fields
}
func (VersionError) Error ¶
func (e VersionError) Error() string
Click to show internal directories.
Click to hide internal directories.