Documentation
¶
Index ¶
Constants ¶
View Source
const ( ChecksumSize = 512 / 8 ChunkSize = 256 SaltSize = 512 IVSize = aes.BlockSize DataSize = ChunkSize - 1 KeySize = 32 HMACKeySize = 256 )
View Source
const DefaultSaltSize = 1024
Variables ¶
View Source
var (
ErrDecryptionFailed = errors.New("decryption failed")
)
Functions ¶
This section is empty.
Types ¶
type Argon ¶
type Argon struct {
Time uint32 `json:"time"`
Memory uint32 `json:"memory"`
Threads uint8 `json:"threads"`
}
func DefaultArgon ¶
func DefaultArgon() (a Argon)
type Job ¶
func (*Job) Decrypt ¶
Decrypt populates the Data field of Job struct with the decrypted secret on success On failure returns ErrDecryptionFailed
type Secret ¶
type Secret struct {
// Configuration for the argon function
Argon Argon `json:"argon"`
// Initialization Vector (IV)
// To initialize it always all the Init() function
IV []byte `json:"iv"`
// Key salt is the Argon Salt to use for the key stretching process
// To initialize it always all the Init() function
KeySalt []byte `json:"keySalt"`
// Salt used for the HMAC calculation
HMACSalt []byte `json:"hmacSalt"`
// The actual cipher text created after encrypting the msg
// Divided in blocks of 256 bytes
// The last block correspond to the actual data and a padding. Of which to prevent Padding oracle attack
// The padding is always a valid number
Cipher []byte `json:"cipher"`
// HMAC is used to verify the authenticity of the encrypted cipher
// This will ensure the algorithm enver tries to decrypt data user never encrypted
HMAC []byte `json:"hmac"`
}
Click to show internal directories.
Click to hide internal directories.