Documentation ¶
Overview ¶
Package crypto implements cryptographic functions for Kerberos 5 implementation.
Index ¶
- func DecryptEncPart(ed types.EncryptedData, key types.EncryptionKey, usage uint32) ([]byte, error)
- func DecryptMessage(ciphertext []byte, key types.EncryptionKey, usage uint32) ([]byte, error)
- func GetChksumEtype(id int32) (etype.EType, error)
- func GetEncryptedData(plainBytes []byte, key types.EncryptionKey, usage uint32, kvno int) (types.EncryptedData, error)
- func GetEtype(id int32) (etype.EType, error)
- func GetKeyFromPassword(passwd string, cname types.PrincipalName, realm string, etypeID int32, ...) (types.EncryptionKey, etype.EType, error)
- type Aes128CtsHmacSha256128
- func (e Aes128CtsHmacSha256128) DecryptData(key, data []byte) ([]byte, error)
- func (e Aes128CtsHmacSha256128) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
- func (e Aes128CtsHmacSha256128) DeriveKey(protocolKey, usage []byte) ([]byte, error)
- func (e Aes128CtsHmacSha256128) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
- func (e Aes128CtsHmacSha256128) EncryptData(key, data []byte) ([]byte, []byte, error)
- func (e Aes128CtsHmacSha256128) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
- func (e Aes128CtsHmacSha256128) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
- func (e Aes128CtsHmacSha256128) GetConfounderByteSize() int
- func (e Aes128CtsHmacSha256128) GetCypherBlockBitLength() int
- func (e Aes128CtsHmacSha256128) GetDefaultStringToKeyParams() string
- func (e Aes128CtsHmacSha256128) GetETypeID() int32
- func (e Aes128CtsHmacSha256128) GetHMACBitLength() int
- func (e Aes128CtsHmacSha256128) GetHashFunc() func() hash.Hash
- func (e Aes128CtsHmacSha256128) GetHashID() int32
- func (e Aes128CtsHmacSha256128) GetKeyByteSize() int
- func (e Aes128CtsHmacSha256128) GetKeySeedBitLength() int
- func (e Aes128CtsHmacSha256128) GetMessageBlockByteSize() int
- func (e Aes128CtsHmacSha256128) RandomToKey(b []byte) []byte
- func (e Aes128CtsHmacSha256128) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
- func (e Aes128CtsHmacSha256128) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
- func (e Aes128CtsHmacSha256128) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
- type Aes128CtsHmacSha96
- func (e Aes128CtsHmacSha96) DecryptData(key, data []byte) ([]byte, error)
- func (e Aes128CtsHmacSha96) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
- func (e Aes128CtsHmacSha96) DeriveKey(protocolKey, usage []byte) ([]byte, error)
- func (e Aes128CtsHmacSha96) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
- func (e Aes128CtsHmacSha96) EncryptData(key, data []byte) ([]byte, []byte, error)
- func (e Aes128CtsHmacSha96) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
- func (e Aes128CtsHmacSha96) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
- func (e Aes128CtsHmacSha96) GetConfounderByteSize() int
- func (e Aes128CtsHmacSha96) GetCypherBlockBitLength() int
- func (e Aes128CtsHmacSha96) GetDefaultStringToKeyParams() string
- func (e Aes128CtsHmacSha96) GetETypeID() int32
- func (e Aes128CtsHmacSha96) GetHMACBitLength() int
- func (e Aes128CtsHmacSha96) GetHashFunc() func() hash.Hash
- func (e Aes128CtsHmacSha96) GetHashID() int32
- func (e Aes128CtsHmacSha96) GetKeyByteSize() int
- func (e Aes128CtsHmacSha96) GetKeySeedBitLength() int
- func (e Aes128CtsHmacSha96) GetMessageBlockByteSize() int
- func (e Aes128CtsHmacSha96) RandomToKey(b []byte) []byte
- func (e Aes128CtsHmacSha96) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
- func (e Aes128CtsHmacSha96) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
- func (e Aes128CtsHmacSha96) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
- type Aes256CtsHmacSha384192
- func (e Aes256CtsHmacSha384192) DecryptData(key, data []byte) ([]byte, error)
- func (e Aes256CtsHmacSha384192) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
- func (e Aes256CtsHmacSha384192) DeriveKey(protocolKey, usage []byte) ([]byte, error)
- func (e Aes256CtsHmacSha384192) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
- func (e Aes256CtsHmacSha384192) EncryptData(key, data []byte) ([]byte, []byte, error)
- func (e Aes256CtsHmacSha384192) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
- func (e Aes256CtsHmacSha384192) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
- func (e Aes256CtsHmacSha384192) GetConfounderByteSize() int
- func (e Aes256CtsHmacSha384192) GetCypherBlockBitLength() int
- func (e Aes256CtsHmacSha384192) GetDefaultStringToKeyParams() string
- func (e Aes256CtsHmacSha384192) GetETypeID() int32
- func (e Aes256CtsHmacSha384192) GetHMACBitLength() int
- func (e Aes256CtsHmacSha384192) GetHashFunc() func() hash.Hash
- func (e Aes256CtsHmacSha384192) GetHashID() int32
- func (e Aes256CtsHmacSha384192) GetKeyByteSize() int
- func (e Aes256CtsHmacSha384192) GetKeySeedBitLength() int
- func (e Aes256CtsHmacSha384192) GetMessageBlockByteSize() int
- func (e Aes256CtsHmacSha384192) RandomToKey(b []byte) []byte
- func (e Aes256CtsHmacSha384192) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
- func (e Aes256CtsHmacSha384192) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
- func (e Aes256CtsHmacSha384192) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
- type Aes256CtsHmacSha96
- func (e Aes256CtsHmacSha96) DecryptData(key, data []byte) ([]byte, error)
- func (e Aes256CtsHmacSha96) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
- func (e Aes256CtsHmacSha96) DeriveKey(protocolKey, usage []byte) ([]byte, error)
- func (e Aes256CtsHmacSha96) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
- func (e Aes256CtsHmacSha96) EncryptData(key, data []byte) ([]byte, []byte, error)
- func (e Aes256CtsHmacSha96) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
- func (e Aes256CtsHmacSha96) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
- func (e Aes256CtsHmacSha96) GetConfounderByteSize() int
- func (e Aes256CtsHmacSha96) GetCypherBlockBitLength() int
- func (e Aes256CtsHmacSha96) GetDefaultStringToKeyParams() string
- func (e Aes256CtsHmacSha96) GetETypeID() int32
- func (e Aes256CtsHmacSha96) GetHMACBitLength() int
- func (e Aes256CtsHmacSha96) GetHashFunc() func() hash.Hash
- func (e Aes256CtsHmacSha96) GetHashID() int32
- func (e Aes256CtsHmacSha96) GetKeyByteSize() int
- func (e Aes256CtsHmacSha96) GetKeySeedBitLength() int
- func (e Aes256CtsHmacSha96) GetMessageBlockByteSize() int
- func (e Aes256CtsHmacSha96) RandomToKey(b []byte) []byte
- func (e Aes256CtsHmacSha96) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
- func (e Aes256CtsHmacSha96) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
- func (e Aes256CtsHmacSha96) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
- type Des3CbcSha1Kd
- func (e Des3CbcSha1Kd) DecryptData(key, data []byte) ([]byte, error)
- func (e Des3CbcSha1Kd) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
- func (e Des3CbcSha1Kd) DeriveKey(protocolKey, usage []byte) ([]byte, error)
- func (e Des3CbcSha1Kd) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
- func (e Des3CbcSha1Kd) EncryptData(key, data []byte) ([]byte, []byte, error)
- func (e Des3CbcSha1Kd) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
- func (e Des3CbcSha1Kd) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
- func (e Des3CbcSha1Kd) GetConfounderByteSize() int
- func (e Des3CbcSha1Kd) GetCypherBlockBitLength() int
- func (e Des3CbcSha1Kd) GetDefaultStringToKeyParams() string
- func (e Des3CbcSha1Kd) GetETypeID() int32
- func (e Des3CbcSha1Kd) GetHMACBitLength() int
- func (e Des3CbcSha1Kd) GetHashFunc() func() hash.Hash
- func (e Des3CbcSha1Kd) GetHashID() int32
- func (e Des3CbcSha1Kd) GetKeyByteSize() int
- func (e Des3CbcSha1Kd) GetKeySeedBitLength() int
- func (e Des3CbcSha1Kd) GetMessageBlockByteSize() int
- func (e Des3CbcSha1Kd) RandomToKey(b []byte) []byte
- func (e Des3CbcSha1Kd) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
- func (e Des3CbcSha1Kd) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
- func (e Des3CbcSha1Kd) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
- type RC4HMAC
- func (e RC4HMAC) DecryptData(key, data []byte) ([]byte, error)
- func (e RC4HMAC) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
- func (e RC4HMAC) DeriveKey(protocolKey, usage []byte) ([]byte, error)
- func (e RC4HMAC) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
- func (e RC4HMAC) EncryptData(key, data []byte) ([]byte, []byte, error)
- func (e RC4HMAC) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
- func (e RC4HMAC) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
- func (e RC4HMAC) GetConfounderByteSize() int
- func (e RC4HMAC) GetCypherBlockBitLength() int
- func (e RC4HMAC) GetDefaultStringToKeyParams() string
- func (e RC4HMAC) GetETypeID() int32
- func (e RC4HMAC) GetHMACBitLength() int
- func (e RC4HMAC) GetHashFunc() func() hash.Hash
- func (e RC4HMAC) GetHashID() int32
- func (e RC4HMAC) GetKeyByteSize() int
- func (e RC4HMAC) GetKeySeedBitLength() int
- func (e RC4HMAC) GetMessageBlockByteSize() int
- func (e RC4HMAC) RandomToKey(b []byte) []byte
- func (e RC4HMAC) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
- func (e RC4HMAC) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
- func (e RC4HMAC) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptEncPart ¶
func DecryptEncPart(ed types.EncryptedData, key types.EncryptionKey, usage uint32) ([]byte, error)
DecryptEncPart decrypts the EncryptedData.
func DecryptMessage ¶
DecryptMessage decrypts the ciphertext and verifies the integrity.
func GetChksumEtype ¶
GetChksumEtype returns an instances of the required etype struct for the checksum ID.
func GetEncryptedData ¶
func GetEncryptedData(plainBytes []byte, key types.EncryptionKey, usage uint32, kvno int) (types.EncryptedData, error)
GetEncryptedData encrypts the data provided and returns and EncryptedData type. Pass a usage value of zero to use the key provided directly rather than deriving one.
func GetKeyFromPassword ¶
func GetKeyFromPassword(passwd string, cname types.PrincipalName, realm string, etypeID int32, pas types.PADataSequence) (types.EncryptionKey, etype.EType, error)
GetKeyFromPassword generates an encryption key from the principal's password.
Types ¶
type Aes128CtsHmacSha256128 ¶
type Aes128CtsHmacSha256128 struct { }
Aes128CtsHmacSha256128 implements Kerberos encryption type aes128-cts-hmac-sha256-128
func (Aes128CtsHmacSha256128) DecryptData ¶
func (e Aes128CtsHmacSha256128) DecryptData(key, data []byte) ([]byte, error)
DecryptData decrypts the data provided.
func (Aes128CtsHmacSha256128) DecryptMessage ¶
func (e Aes128CtsHmacSha256128) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
DecryptMessage decrypts the message provided and verifies the integrity of the message.
func (Aes128CtsHmacSha256128) DeriveKey ¶
func (e Aes128CtsHmacSha256128) DeriveKey(protocolKey, usage []byte) ([]byte, error)
DeriveKey derives a key from the protocol key based on the usage value.
func (Aes128CtsHmacSha256128) DeriveRandom ¶
func (e Aes128CtsHmacSha256128) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
DeriveRandom generates data needed for key generation.
func (Aes128CtsHmacSha256128) EncryptData ¶
func (e Aes128CtsHmacSha256128) EncryptData(key, data []byte) ([]byte, []byte, error)
EncryptData encrypts the data provided.
func (Aes128CtsHmacSha256128) EncryptMessage ¶
func (e Aes128CtsHmacSha256128) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func (Aes128CtsHmacSha256128) GetChecksumHash ¶
func (e Aes128CtsHmacSha256128) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func (Aes128CtsHmacSha256128) GetConfounderByteSize ¶
func (e Aes128CtsHmacSha256128) GetConfounderByteSize() int
GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func (Aes128CtsHmacSha256128) GetCypherBlockBitLength ¶
func (e Aes128CtsHmacSha256128) GetCypherBlockBitLength() int
GetCypherBlockBitLength returns the bit count size of the cypher block.
func (Aes128CtsHmacSha256128) GetDefaultStringToKeyParams ¶
func (e Aes128CtsHmacSha256128) GetDefaultStringToKeyParams() string
GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func (Aes128CtsHmacSha256128) GetETypeID ¶
func (e Aes128CtsHmacSha256128) GetETypeID() int32
GetETypeID returns the EType ID number.
func (Aes128CtsHmacSha256128) GetHMACBitLength ¶
func (e Aes128CtsHmacSha256128) GetHMACBitLength() int
GetHMACBitLength returns the bit count size of the integrity hash.
func (Aes128CtsHmacSha256128) GetHashFunc ¶
func (e Aes128CtsHmacSha256128) GetHashFunc() func() hash.Hash
GetHashFunc returns the hash function for this etype.
func (Aes128CtsHmacSha256128) GetHashID ¶
func (e Aes128CtsHmacSha256128) GetHashID() int32
GetHashID returns the checksum type ID number.
func (Aes128CtsHmacSha256128) GetKeyByteSize ¶
func (e Aes128CtsHmacSha256128) GetKeyByteSize() int
GetKeyByteSize returns the number of bytes for key of this etype.
func (Aes128CtsHmacSha256128) GetKeySeedBitLength ¶
func (e Aes128CtsHmacSha256128) GetKeySeedBitLength() int
GetKeySeedBitLength returns the number of bits for the seed for key generation.
func (Aes128CtsHmacSha256128) GetMessageBlockByteSize ¶
func (e Aes128CtsHmacSha256128) GetMessageBlockByteSize() int
GetMessageBlockByteSize returns the block size for the etype's messages.
func (Aes128CtsHmacSha256128) RandomToKey ¶
func (e Aes128CtsHmacSha256128) RandomToKey(b []byte) []byte
RandomToKey returns a key from the bytes provided.
func (Aes128CtsHmacSha256128) StringToKey ¶
func (e Aes128CtsHmacSha256128) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
StringToKey returns a key derived from the string provided.
func (Aes128CtsHmacSha256128) VerifyChecksum ¶
func (e Aes128CtsHmacSha256128) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
func (Aes128CtsHmacSha256128) VerifyIntegrity ¶
func (e Aes128CtsHmacSha256128) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
VerifyIntegrity checks the integrity of the ciphertext message. The HMAC is calculated over the cipher state concatenated with the AES output, instead of being calculated over the confounder and plaintext. This allows the message receiver to verify the integrity of the message before decrypting the message. Therefore the pt value to this interface method is not use. Pass any []byte.
type Aes128CtsHmacSha96 ¶
type Aes128CtsHmacSha96 struct { }
Aes128CtsHmacSha96 implements Kerberos encryption type aes128-cts-hmac-sha1-96
func (Aes128CtsHmacSha96) DecryptData ¶
func (e Aes128CtsHmacSha96) DecryptData(key, data []byte) ([]byte, error)
DecryptData decrypts the data provided.
func (Aes128CtsHmacSha96) DecryptMessage ¶
func (e Aes128CtsHmacSha96) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
DecryptMessage decrypts the message provided and verifies the integrity of the message.
func (Aes128CtsHmacSha96) DeriveKey ¶
func (e Aes128CtsHmacSha96) DeriveKey(protocolKey, usage []byte) ([]byte, error)
DeriveKey derives a key from the protocol key based on the usage value.
func (Aes128CtsHmacSha96) DeriveRandom ¶
func (e Aes128CtsHmacSha96) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
DeriveRandom generates data needed for key generation.
func (Aes128CtsHmacSha96) EncryptData ¶
func (e Aes128CtsHmacSha96) EncryptData(key, data []byte) ([]byte, []byte, error)
EncryptData encrypts the data provided.
func (Aes128CtsHmacSha96) EncryptMessage ¶
func (e Aes128CtsHmacSha96) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func (Aes128CtsHmacSha96) GetChecksumHash ¶
func (e Aes128CtsHmacSha96) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func (Aes128CtsHmacSha96) GetConfounderByteSize ¶
func (e Aes128CtsHmacSha96) GetConfounderByteSize() int
GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func (Aes128CtsHmacSha96) GetCypherBlockBitLength ¶
func (e Aes128CtsHmacSha96) GetCypherBlockBitLength() int
GetCypherBlockBitLength returns the bit count size of the cypher block.
func (Aes128CtsHmacSha96) GetDefaultStringToKeyParams ¶
func (e Aes128CtsHmacSha96) GetDefaultStringToKeyParams() string
GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func (Aes128CtsHmacSha96) GetETypeID ¶
func (e Aes128CtsHmacSha96) GetETypeID() int32
GetETypeID returns the EType ID number.
func (Aes128CtsHmacSha96) GetHMACBitLength ¶
func (e Aes128CtsHmacSha96) GetHMACBitLength() int
GetHMACBitLength returns the bit count size of the integrity hash.
func (Aes128CtsHmacSha96) GetHashFunc ¶
func (e Aes128CtsHmacSha96) GetHashFunc() func() hash.Hash
GetHashFunc returns the hash function for this etype.
func (Aes128CtsHmacSha96) GetHashID ¶
func (e Aes128CtsHmacSha96) GetHashID() int32
GetHashID returns the checksum type ID number.
func (Aes128CtsHmacSha96) GetKeyByteSize ¶
func (e Aes128CtsHmacSha96) GetKeyByteSize() int
GetKeyByteSize returns the number of bytes for key of this etype.
func (Aes128CtsHmacSha96) GetKeySeedBitLength ¶
func (e Aes128CtsHmacSha96) GetKeySeedBitLength() int
GetKeySeedBitLength returns the number of bits for the seed for key generation.
func (Aes128CtsHmacSha96) GetMessageBlockByteSize ¶
func (e Aes128CtsHmacSha96) GetMessageBlockByteSize() int
GetMessageBlockByteSize returns the block size for the etype's messages.
func (Aes128CtsHmacSha96) RandomToKey ¶
func (e Aes128CtsHmacSha96) RandomToKey(b []byte) []byte
RandomToKey returns a key from the bytes provided.
func (Aes128CtsHmacSha96) StringToKey ¶
func (e Aes128CtsHmacSha96) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
StringToKey returns a key derived from the string provided.
func (Aes128CtsHmacSha96) VerifyChecksum ¶
func (e Aes128CtsHmacSha96) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
func (Aes128CtsHmacSha96) VerifyIntegrity ¶
func (e Aes128CtsHmacSha96) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
VerifyIntegrity checks the integrity of the plaintext message.
type Aes256CtsHmacSha384192 ¶
type Aes256CtsHmacSha384192 struct { }
Aes256CtsHmacSha384192 implements Kerberos encryption type aes256-cts-hmac-sha384-192
func (Aes256CtsHmacSha384192) DecryptData ¶
func (e Aes256CtsHmacSha384192) DecryptData(key, data []byte) ([]byte, error)
DecryptData decrypts the data provided.
func (Aes256CtsHmacSha384192) DecryptMessage ¶
func (e Aes256CtsHmacSha384192) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
DecryptMessage decrypts the message provided and verifies the integrity of the message.
func (Aes256CtsHmacSha384192) DeriveKey ¶
func (e Aes256CtsHmacSha384192) DeriveKey(protocolKey, usage []byte) ([]byte, error)
DeriveKey derives a key from the protocol key based on the usage value.
func (Aes256CtsHmacSha384192) DeriveRandom ¶
func (e Aes256CtsHmacSha384192) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
DeriveRandom generates data needed for key generation.
func (Aes256CtsHmacSha384192) EncryptData ¶
func (e Aes256CtsHmacSha384192) EncryptData(key, data []byte) ([]byte, []byte, error)
EncryptData encrypts the data provided.
func (Aes256CtsHmacSha384192) EncryptMessage ¶
func (e Aes256CtsHmacSha384192) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func (Aes256CtsHmacSha384192) GetChecksumHash ¶
func (e Aes256CtsHmacSha384192) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func (Aes256CtsHmacSha384192) GetConfounderByteSize ¶
func (e Aes256CtsHmacSha384192) GetConfounderByteSize() int
GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func (Aes256CtsHmacSha384192) GetCypherBlockBitLength ¶
func (e Aes256CtsHmacSha384192) GetCypherBlockBitLength() int
GetCypherBlockBitLength returns the bit count size of the cypher block.
func (Aes256CtsHmacSha384192) GetDefaultStringToKeyParams ¶
func (e Aes256CtsHmacSha384192) GetDefaultStringToKeyParams() string
GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func (Aes256CtsHmacSha384192) GetETypeID ¶
func (e Aes256CtsHmacSha384192) GetETypeID() int32
GetETypeID returns the EType ID number.
func (Aes256CtsHmacSha384192) GetHMACBitLength ¶
func (e Aes256CtsHmacSha384192) GetHMACBitLength() int
GetHMACBitLength returns the bit count size of the integrity hash.
func (Aes256CtsHmacSha384192) GetHashFunc ¶
func (e Aes256CtsHmacSha384192) GetHashFunc() func() hash.Hash
GetHashFunc returns the hash function for this etype.
func (Aes256CtsHmacSha384192) GetHashID ¶
func (e Aes256CtsHmacSha384192) GetHashID() int32
GetHashID returns the checksum type ID number.
func (Aes256CtsHmacSha384192) GetKeyByteSize ¶
func (e Aes256CtsHmacSha384192) GetKeyByteSize() int
GetKeyByteSize returns the number of bytes for key of this etype.
func (Aes256CtsHmacSha384192) GetKeySeedBitLength ¶
func (e Aes256CtsHmacSha384192) GetKeySeedBitLength() int
GetKeySeedBitLength returns the number of bits for the seed for key generation.
func (Aes256CtsHmacSha384192) GetMessageBlockByteSize ¶
func (e Aes256CtsHmacSha384192) GetMessageBlockByteSize() int
GetMessageBlockByteSize returns the block size for the etype's messages.
func (Aes256CtsHmacSha384192) RandomToKey ¶
func (e Aes256CtsHmacSha384192) RandomToKey(b []byte) []byte
RandomToKey returns a key from the bytes provided.
func (Aes256CtsHmacSha384192) StringToKey ¶
func (e Aes256CtsHmacSha384192) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
StringToKey returns a key derived from the string provided.
func (Aes256CtsHmacSha384192) VerifyChecksum ¶
func (e Aes256CtsHmacSha384192) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
func (Aes256CtsHmacSha384192) VerifyIntegrity ¶
func (e Aes256CtsHmacSha384192) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
VerifyIntegrity checks the integrity of the ciphertext message. The HMAC is calculated over the cipher state concatenated with the AES output, instead of being calculated over the confounder and plaintext. This allows the message receiver to verify the integrity of the message before decrypting the message. Therefore the pt value to this interface method is not use. Pass any []byte.
type Aes256CtsHmacSha96 ¶
type Aes256CtsHmacSha96 struct { }
Aes256CtsHmacSha96 implements Kerberos encryption type aes256-cts-hmac-sha1-96
func (Aes256CtsHmacSha96) DecryptData ¶
func (e Aes256CtsHmacSha96) DecryptData(key, data []byte) ([]byte, error)
DecryptData decrypts the data provided.
func (Aes256CtsHmacSha96) DecryptMessage ¶
func (e Aes256CtsHmacSha96) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
DecryptMessage decrypts the message provided and verifies the integrity of the message.
func (Aes256CtsHmacSha96) DeriveKey ¶
func (e Aes256CtsHmacSha96) DeriveKey(protocolKey, usage []byte) ([]byte, error)
DeriveKey derives a key from the protocol key based on the usage value.
func (Aes256CtsHmacSha96) DeriveRandom ¶
func (e Aes256CtsHmacSha96) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
DeriveRandom generates data needed for key generation.
func (Aes256CtsHmacSha96) EncryptData ¶
func (e Aes256CtsHmacSha96) EncryptData(key, data []byte) ([]byte, []byte, error)
EncryptData encrypts the data provided.
func (Aes256CtsHmacSha96) EncryptMessage ¶
func (e Aes256CtsHmacSha96) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)
EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func (Aes256CtsHmacSha96) GetChecksumHash ¶
func (e Aes256CtsHmacSha96) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func (Aes256CtsHmacSha96) GetConfounderByteSize ¶
func (e Aes256CtsHmacSha96) GetConfounderByteSize() int
GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func (Aes256CtsHmacSha96) GetCypherBlockBitLength ¶
func (e Aes256CtsHmacSha96) GetCypherBlockBitLength() int
GetCypherBlockBitLength returns the bit count size of the cypher block.
func (Aes256CtsHmacSha96) GetDefaultStringToKeyParams ¶
func (e Aes256CtsHmacSha96) GetDefaultStringToKeyParams() string
GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func (Aes256CtsHmacSha96) GetETypeID ¶
func (e Aes256CtsHmacSha96) GetETypeID() int32
GetETypeID returns the EType ID number.
func (Aes256CtsHmacSha96) GetHMACBitLength ¶
func (e Aes256CtsHmacSha96) GetHMACBitLength() int
GetHMACBitLength returns the bit count size of the integrity hash.
func (Aes256CtsHmacSha96) GetHashFunc ¶
func (e Aes256CtsHmacSha96) GetHashFunc() func() hash.Hash
GetHashFunc returns the hash function for this etype.
func (Aes256CtsHmacSha96) GetHashID ¶
func (e Aes256CtsHmacSha96) GetHashID() int32
GetHashID returns the checksum type ID number.
func (Aes256CtsHmacSha96) GetKeyByteSize ¶
func (e Aes256CtsHmacSha96) GetKeyByteSize() int
GetKeyByteSize returns the number of bytes for key of this etype.
func (Aes256CtsHmacSha96) GetKeySeedBitLength ¶
func (e Aes256CtsHmacSha96) GetKeySeedBitLength() int
GetKeySeedBitLength returns the number of bits for the seed for key generation.
func (Aes256CtsHmacSha96) GetMessageBlockByteSize ¶
func (e Aes256CtsHmacSha96) GetMessageBlockByteSize() int
GetMessageBlockByteSize returns the block size for the etype's messages.
func (Aes256CtsHmacSha96) RandomToKey ¶
func (e Aes256CtsHmacSha96) RandomToKey(b []byte) []byte
RandomToKey returns a key from the bytes provided.
func (Aes256CtsHmacSha96) StringToKey ¶
func (e Aes256CtsHmacSha96) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)
StringToKey returns a key derived from the string provided.
func (Aes256CtsHmacSha96) VerifyChecksum ¶
func (e Aes256CtsHmacSha96) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
func (Aes256CtsHmacSha96) VerifyIntegrity ¶
func (e Aes256CtsHmacSha96) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
VerifyIntegrity checks the integrity of the plaintext message.
type Des3CbcSha1Kd ¶
type Des3CbcSha1Kd struct { }
Des3CbcSha1Kd implements Kerberos encryption type des3-cbc-hmac-sha1-kd
func (Des3CbcSha1Kd) DecryptData ¶
func (e Des3CbcSha1Kd) DecryptData(key, data []byte) ([]byte, error)
DecryptData decrypts the data provided.
func (Des3CbcSha1Kd) DecryptMessage ¶
func (e Des3CbcSha1Kd) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)
DecryptMessage decrypts the message provided and verifies the integrity of the message.
func (Des3CbcSha1Kd) DeriveKey ¶
func (e Des3CbcSha1Kd) DeriveKey(protocolKey, usage []byte) ([]byte, error)
DeriveKey derives a key from the protocol key based on the usage value.
func (Des3CbcSha1Kd) DeriveRandom ¶
func (e Des3CbcSha1Kd) DeriveRandom(protocolKey, usage []byte) ([]byte, error)
DeriveRandom generates data needed for key generation.
func (Des3CbcSha1Kd) EncryptData ¶
func (e Des3CbcSha1Kd) EncryptData(key, data []byte) ([]byte, []byte, error)
EncryptData encrypts the data provided.
func (Des3CbcSha1Kd) EncryptMessage ¶
EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func (Des3CbcSha1Kd) GetChecksumHash ¶
func (e Des3CbcSha1Kd) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func (Des3CbcSha1Kd) GetConfounderByteSize ¶
func (e Des3CbcSha1Kd) GetConfounderByteSize() int
GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func (Des3CbcSha1Kd) GetCypherBlockBitLength ¶
func (e Des3CbcSha1Kd) GetCypherBlockBitLength() int
GetCypherBlockBitLength returns the bit count size of the cypher block.
func (Des3CbcSha1Kd) GetDefaultStringToKeyParams ¶
func (e Des3CbcSha1Kd) GetDefaultStringToKeyParams() string
GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func (Des3CbcSha1Kd) GetETypeID ¶
func (e Des3CbcSha1Kd) GetETypeID() int32
GetETypeID returns the EType ID number.
func (Des3CbcSha1Kd) GetHMACBitLength ¶
func (e Des3CbcSha1Kd) GetHMACBitLength() int
GetHMACBitLength returns the bit count size of the integrity hash.
func (Des3CbcSha1Kd) GetHashFunc ¶
func (e Des3CbcSha1Kd) GetHashFunc() func() hash.Hash
GetHashFunc returns the hash function for this etype.
func (Des3CbcSha1Kd) GetHashID ¶
func (e Des3CbcSha1Kd) GetHashID() int32
GetHashID returns the checksum type ID number.
func (Des3CbcSha1Kd) GetKeyByteSize ¶
func (e Des3CbcSha1Kd) GetKeyByteSize() int
GetKeyByteSize returns the number of bytes for key of this etype.
func (Des3CbcSha1Kd) GetKeySeedBitLength ¶
func (e Des3CbcSha1Kd) GetKeySeedBitLength() int
GetKeySeedBitLength returns the number of bits for the seed for key generation.
func (Des3CbcSha1Kd) GetMessageBlockByteSize ¶
func (e Des3CbcSha1Kd) GetMessageBlockByteSize() int
GetMessageBlockByteSize returns the block size for the etype's messages.
func (Des3CbcSha1Kd) RandomToKey ¶
func (e Des3CbcSha1Kd) RandomToKey(b []byte) []byte
RandomToKey returns a key from the bytes provided.
func (Des3CbcSha1Kd) StringToKey ¶
StringToKey returns a key derived from the string provided.
func (Des3CbcSha1Kd) VerifyChecksum ¶
func (e Des3CbcSha1Kd) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool
VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
func (Des3CbcSha1Kd) VerifyIntegrity ¶
func (e Des3CbcSha1Kd) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool
VerifyIntegrity checks the integrity of the plaintext message.
type RC4HMAC ¶
type RC4HMAC struct { }
RC4HMAC implements Kerberos encryption type aes256-cts-hmac-sha1-96
func (RC4HMAC) DecryptData ¶
DecryptData decrypts the data provided.
func (RC4HMAC) DecryptMessage ¶
DecryptMessage decrypts the message provided and verifies the integrity of the message.
func (RC4HMAC) DeriveRandom ¶
DeriveRandom generates data needed for key generation.
func (RC4HMAC) EncryptData ¶
EncryptData encrypts the data provided.
func (RC4HMAC) EncryptMessage ¶
EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func (RC4HMAC) GetChecksumHash ¶
GetChecksumHash returns a keyed checksum hash of the bytes provided.
func (RC4HMAC) GetConfounderByteSize ¶
GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func (RC4HMAC) GetCypherBlockBitLength ¶
GetCypherBlockBitLength returns the bit count size of the cypher block.
func (RC4HMAC) GetDefaultStringToKeyParams ¶
GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func (RC4HMAC) GetETypeID ¶
GetETypeID returns the EType ID number.
func (RC4HMAC) GetHMACBitLength ¶
GetHMACBitLength returns the bit count size of the integrity hash.
func (RC4HMAC) GetHashFunc ¶
GetHashFunc returns the hash function for this etype.
func (RC4HMAC) GetKeyByteSize ¶
GetKeyByteSize returns the number of bytes for key of this etype.
func (RC4HMAC) GetKeySeedBitLength ¶
GetKeySeedBitLength returns the number of bits for the seed for key generation.
func (RC4HMAC) GetMessageBlockByteSize ¶
GetMessageBlockByteSize returns the block size for the etype's messages.
func (RC4HMAC) RandomToKey ¶
RandomToKey returns a key from the bytes provided.
func (RC4HMAC) StringToKey ¶
StringToKey returns a key derived from the string provided.
func (RC4HMAC) VerifyChecksum ¶
VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package common provides encryption methods common across encryption types
|
Package common provides encryption methods common across encryption types |
Package etype provides the Kerberos Encryption Type interface
|
Package etype provides the Kerberos Encryption Type interface |
Package rfc3961 provides encryption and checksum methods as specified in RFC 3961
|
Package rfc3961 provides encryption and checksum methods as specified in RFC 3961 |
Package rfc3962 provides encryption and checksum methods as specified in RFC 3962
|
Package rfc3962 provides encryption and checksum methods as specified in RFC 3962 |
Package rfc4757 provides encryption and checksum methods as specified in RFC 4757
|
Package rfc4757 provides encryption and checksum methods as specified in RFC 4757 |
Package rfc8009 provides encryption and checksum methods as specified in RFC 8009
|
Package rfc8009 provides encryption and checksum methods as specified in RFC 8009 |