crypto

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package crypto implements cryptographic functions for Kerberos 5 implementation.

Index

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

func DecryptMessage(ciphertext []byte, key types.EncryptionKey, usage uint32) ([]byte, error)

DecryptMessage decrypts the ciphertext and verifies the integrity.

func GetChksumEtype

func GetChksumEtype(id int) (etype.EType, error)

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 GetEtype

func GetEtype(id int) (etype.EType, error)

GetEtype returns an instances of the required etype struct for the etype ID.

func GetKeyFromPassword

func GetKeyFromPassword(passwd string, cname types.PrincipalName, realm string, etypeID int, 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() int

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() int

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() int

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() int

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() int

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() int

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() int

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() int

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) (message []byte, err 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

func (e Des3CbcSha1Kd) 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 (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() int

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() int

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

func (e Des3CbcSha1Kd) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)

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

func (e RC4HMAC) DecryptData(key, data []byte) ([]byte, error)

DecryptData decrypts the data provided.

func (RC4HMAC) DecryptMessage

func (e RC4HMAC) DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error)

DecryptMessage decrypts the message provided and verifies the integrity of the message.

func (RC4HMAC) DeriveKey

func (e RC4HMAC) DeriveKey(protocolKey, usage []byte) ([]byte, error)

DeriveKey derives a key from the protocol key based on the usage value.

func (RC4HMAC) DeriveRandom

func (e RC4HMAC) DeriveRandom(protocolKey, usage []byte) ([]byte, error)

DeriveRandom generates data needed for key generation.

func (RC4HMAC) EncryptData

func (e RC4HMAC) EncryptData(key, data []byte) ([]byte, []byte, error)

EncryptData encrypts the data provided.

func (RC4HMAC) EncryptMessage

func (e RC4HMAC) 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 (RC4HMAC) GetChecksumHash

func (e RC4HMAC) GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error)

GetChecksumHash returns a keyed checksum hash of the bytes provided.

func (RC4HMAC) GetConfounderByteSize

func (e RC4HMAC) GetConfounderByteSize() int

GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.

func (RC4HMAC) GetCypherBlockBitLength

func (e RC4HMAC) GetCypherBlockBitLength() int

GetCypherBlockBitLength returns the bit count size of the cypher block.

func (RC4HMAC) GetDefaultStringToKeyParams

func (e RC4HMAC) GetDefaultStringToKeyParams() string

GetDefaultStringToKeyParams returns the default key derivation parameters in string form.

func (RC4HMAC) GetETypeID

func (e RC4HMAC) GetETypeID() int

GetETypeID returns the EType ID number.

func (RC4HMAC) GetHMACBitLength

func (e RC4HMAC) GetHMACBitLength() int

GetHMACBitLength returns the bit count size of the integrity hash.

func (RC4HMAC) GetHashFunc

func (e RC4HMAC) GetHashFunc() func() hash.Hash

GetHashFunc returns the hash function for this etype.

func (RC4HMAC) GetHashID

func (e RC4HMAC) GetHashID() int

GetHashID returns the checksum type ID number.

func (RC4HMAC) GetKeyByteSize

func (e RC4HMAC) GetKeyByteSize() int

GetKeyByteSize returns the number of bytes for key of this etype.

func (RC4HMAC) GetKeySeedBitLength

func (e RC4HMAC) GetKeySeedBitLength() int

GetKeySeedBitLength returns the number of bits for the seed for key generation.

func (RC4HMAC) GetMessageBlockByteSize

func (e RC4HMAC) GetMessageBlockByteSize() int

GetMessageBlockByteSize returns the block size for the etype's messages.

func (RC4HMAC) RandomToKey

func (e RC4HMAC) RandomToKey(b []byte) []byte

RandomToKey returns a key from the bytes provided.

func (RC4HMAC) StringToKey

func (e RC4HMAC) StringToKey(secret string, salt string, s2kparams string) ([]byte, error)

StringToKey returns a key derived from the string provided.

func (RC4HMAC) VerifyChecksum

func (e RC4HMAC) VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool

VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.

func (RC4HMAC) VerifyIntegrity

func (e RC4HMAC) VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool

VerifyIntegrity checks the integrity of the plaintext message.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL