Documentation
¶
Overview ¶
Package crypto defines Kerberos encryption-type and checksum interfaces.
Index ¶
- Constants
- Variables
- func CF2(etype EType, key1, key2, pepper1, pepper2 []byte) ([]byte, error)
- func DecryptWithIV(etype EType, key []byte, usage uint32, ciphertext, iv []byte) ([]byte, []byte, error)
- func EncryptWithIV(etype EType, key []byte, usage uint32, plaintext, iv []byte) ([]byte, []byte, error)
- func PRF(etype EType, key, input []byte) ([]byte, error)
- func SetRandomSource(source types.RandomSource) func()
- type EType
- type Registry
- type StatefulEType
Constants ¶
Variables ¶
var RandomSource types.RandomSource = cryptorand.Reader
RandomSource supplies confounders for encryption. Tests may replace it with a deterministic reader; production code leaves it as rand.Reader.
Functions ¶
func DecryptWithIV ¶
func DecryptWithIV(etype EType, key []byte, usage uint32, ciphertext, iv []byte) ([]byte, []byte, error)
DecryptWithIV performs authenticated decryption with an explicit CBC-CTS IV and returns the next MIT auth-context state.
func EncryptWithIV ¶
func EncryptWithIV(etype EType, key []byte, usage uint32, plaintext, iv []byte) ([]byte, []byte, error)
EncryptWithIV performs authenticated encryption with an explicit CBC-CTS IV and returns the next MIT auth-context state.
func SetRandomSource ¶
func SetRandomSource(source types.RandomSource) func()
SetRandomSource replaces the confounder source and returns a restore hook.
Types ¶
type EType ¶
type EType interface {
ID() int32
KeySize() int
StringToKey(password, salt, params []byte) ([]byte, error)
Encrypt(key []byte, usage uint32, plaintext []byte) ([]byte, error)
Decrypt(key []byte, usage uint32, ciphertext []byte) ([]byte, error)
Checksum(key []byte, usage uint32, data []byte) ([]byte, error)
ChecksumSize() int
VerifyChecksum(key []byte, usage uint32, data, checksum []byte) error
}
EType is the common Kerberos encryption-type and checksum contract.
type Registry ¶
type Registry struct{}
Registry selects one of the supported AES enctypes.
func NewRegistry ¶
func NewRegistry() *Registry
type StatefulEType ¶
type StatefulEType interface {
EType
EncryptWithIV(key []byte, usage uint32, plaintext, iv []byte) (ciphertext, nextIV []byte, err error)
DecryptWithIV(key []byte, usage uint32, ciphertext, iv []byte) (plaintext, nextIV []byte, err error)
}
StatefulEType is implemented by block enctypes which support the MIT auth-context cipher state used by KRB-PRIV streams.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package aescts provides the AES ciphertext-stealing primitive for Kerberos.
|
Package aescts provides the AES ciphertext-stealing primitive for Kerberos. |
|
Package rfc3961 provides the Kerberos cryptographic framework from RFC 3961.
|
Package rfc3961 provides the Kerberos cryptographic framework from RFC 3961. |
|
Package rfc3962 provides AES CTS HMAC SHA1 profiles from RFC 3962.
|
Package rfc3962 provides AES CTS HMAC SHA1 profiles from RFC 3962. |
|
Package rfc8009 provides AES CTS HMAC SHA2 profiles from RFC 8009.
|
Package rfc8009 provides AES CTS HMAC SHA2 profiles from RFC 8009. |