crypto

package
v0.0.0-...-fc028b1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Cryptographic packages 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)

func DecryptMessage

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

func GetChksumEtype

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

func GetEncryptedData

func GetEncryptedData(plainBytes []byte, key types.EncryptionKey, usage uint32, kvno int) (types.EncryptedData, error)

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)

func GetKeyFromPassword

func GetKeyFromPassword(passwd string, cname types.PrincipalName, realm string, etypeID int, pas types.PADataSequence) (types.EncryptionKey, etype.EType, error)

Types

type Aes128CtsHmacSha256128

type Aes128CtsHmacSha256128 struct {
}

func (Aes128CtsHmacSha256128) DecryptData

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

func (Aes128CtsHmacSha256128) DecryptMessage

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

func (Aes128CtsHmacSha256128) DeriveKey

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

func (Aes128CtsHmacSha256128) DeriveRandom

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

func (Aes128CtsHmacSha256128) EncryptData

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

func (Aes128CtsHmacSha256128) EncryptMessage

func (e Aes128CtsHmacSha256128) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)

func (Aes128CtsHmacSha256128) GetChecksumHash

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

func (Aes128CtsHmacSha256128) GetConfounderByteSize

func (e Aes128CtsHmacSha256128) GetConfounderByteSize() int

func (Aes128CtsHmacSha256128) GetCypherBlockBitLength

func (e Aes128CtsHmacSha256128) GetCypherBlockBitLength() int

func (Aes128CtsHmacSha256128) GetDefaultStringToKeyParams

func (e Aes128CtsHmacSha256128) GetDefaultStringToKeyParams() string

func (Aes128CtsHmacSha256128) GetETypeID

func (e Aes128CtsHmacSha256128) GetETypeID() int

func (Aes128CtsHmacSha256128) GetHMACBitLength

func (e Aes128CtsHmacSha256128) GetHMACBitLength() int

func (Aes128CtsHmacSha256128) GetHashFunc

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

func (Aes128CtsHmacSha256128) GetHashID

func (e Aes128CtsHmacSha256128) GetHashID() int

func (Aes128CtsHmacSha256128) GetKeyByteSize

func (e Aes128CtsHmacSha256128) GetKeyByteSize() int

func (Aes128CtsHmacSha256128) GetKeySeedBitLength

func (e Aes128CtsHmacSha256128) GetKeySeedBitLength() int

func (Aes128CtsHmacSha256128) GetMessageBlockByteSize

func (e Aes128CtsHmacSha256128) GetMessageBlockByteSize() int

func (Aes128CtsHmacSha256128) RandomToKey

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

func (Aes128CtsHmacSha256128) StringToKey

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

func (Aes128CtsHmacSha256128) VerifyChecksum

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

func (Aes128CtsHmacSha256128) VerifyIntegrity

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

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 {
}

func (Aes128CtsHmacSha96) DecryptData

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

func (Aes128CtsHmacSha96) DecryptMessage

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

func (Aes128CtsHmacSha96) DeriveKey

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

func (Aes128CtsHmacSha96) DeriveRandom

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

func (Aes128CtsHmacSha96) EncryptData

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

func (Aes128CtsHmacSha96) EncryptMessage

func (e Aes128CtsHmacSha96) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)

func (Aes128CtsHmacSha96) GetChecksumHash

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

func (Aes128CtsHmacSha96) GetConfounderByteSize

func (e Aes128CtsHmacSha96) GetConfounderByteSize() int

func (Aes128CtsHmacSha96) GetCypherBlockBitLength

func (e Aes128CtsHmacSha96) GetCypherBlockBitLength() int

func (Aes128CtsHmacSha96) GetDefaultStringToKeyParams

func (e Aes128CtsHmacSha96) GetDefaultStringToKeyParams() string

func (Aes128CtsHmacSha96) GetETypeID

func (e Aes128CtsHmacSha96) GetETypeID() int

func (Aes128CtsHmacSha96) GetHMACBitLength

func (e Aes128CtsHmacSha96) GetHMACBitLength() int

func (Aes128CtsHmacSha96) GetHashFunc

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

func (Aes128CtsHmacSha96) GetHashID

func (e Aes128CtsHmacSha96) GetHashID() int

func (Aes128CtsHmacSha96) GetKeyByteSize

func (e Aes128CtsHmacSha96) GetKeyByteSize() int

func (Aes128CtsHmacSha96) GetKeySeedBitLength

func (e Aes128CtsHmacSha96) GetKeySeedBitLength() int

func (Aes128CtsHmacSha96) GetMessageBlockByteSize

func (e Aes128CtsHmacSha96) GetMessageBlockByteSize() int

func (Aes128CtsHmacSha96) RandomToKey

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

func (Aes128CtsHmacSha96) StringToKey

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

func (Aes128CtsHmacSha96) VerifyChecksum

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

func (Aes128CtsHmacSha96) VerifyIntegrity

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

type Aes256CtsHmacSha384192

type Aes256CtsHmacSha384192 struct {
}

func (Aes256CtsHmacSha384192) DecryptData

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

func (Aes256CtsHmacSha384192) DecryptMessage

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

func (Aes256CtsHmacSha384192) DeriveKey

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

func (Aes256CtsHmacSha384192) DeriveRandom

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

func (Aes256CtsHmacSha384192) EncryptData

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

func (Aes256CtsHmacSha384192) EncryptMessage

func (e Aes256CtsHmacSha384192) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)

func (Aes256CtsHmacSha384192) GetChecksumHash

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

func (Aes256CtsHmacSha384192) GetConfounderByteSize

func (e Aes256CtsHmacSha384192) GetConfounderByteSize() int

func (Aes256CtsHmacSha384192) GetCypherBlockBitLength

func (e Aes256CtsHmacSha384192) GetCypherBlockBitLength() int

func (Aes256CtsHmacSha384192) GetDefaultStringToKeyParams

func (e Aes256CtsHmacSha384192) GetDefaultStringToKeyParams() string

func (Aes256CtsHmacSha384192) GetETypeID

func (e Aes256CtsHmacSha384192) GetETypeID() int

func (Aes256CtsHmacSha384192) GetHMACBitLength

func (e Aes256CtsHmacSha384192) GetHMACBitLength() int

func (Aes256CtsHmacSha384192) GetHashFunc

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

func (Aes256CtsHmacSha384192) GetHashID

func (e Aes256CtsHmacSha384192) GetHashID() int

func (Aes256CtsHmacSha384192) GetKeyByteSize

func (e Aes256CtsHmacSha384192) GetKeyByteSize() int

func (Aes256CtsHmacSha384192) GetKeySeedBitLength

func (e Aes256CtsHmacSha384192) GetKeySeedBitLength() int

func (Aes256CtsHmacSha384192) GetMessageBlockByteSize

func (e Aes256CtsHmacSha384192) GetMessageBlockByteSize() int

func (Aes256CtsHmacSha384192) RandomToKey

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

func (Aes256CtsHmacSha384192) StringToKey

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

func (Aes256CtsHmacSha384192) VerifyChecksum

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

func (Aes256CtsHmacSha384192) VerifyIntegrity

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

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 {
}

func (Aes256CtsHmacSha96) DecryptData

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

func (Aes256CtsHmacSha96) DecryptMessage

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

func (Aes256CtsHmacSha96) DeriveKey

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

func (Aes256CtsHmacSha96) DeriveRandom

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

func (Aes256CtsHmacSha96) EncryptData

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

func (Aes256CtsHmacSha96) EncryptMessage

func (e Aes256CtsHmacSha96) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)

func (Aes256CtsHmacSha96) GetChecksumHash

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

func (Aes256CtsHmacSha96) GetConfounderByteSize

func (e Aes256CtsHmacSha96) GetConfounderByteSize() int

func (Aes256CtsHmacSha96) GetCypherBlockBitLength

func (e Aes256CtsHmacSha96) GetCypherBlockBitLength() int

func (Aes256CtsHmacSha96) GetDefaultStringToKeyParams

func (e Aes256CtsHmacSha96) GetDefaultStringToKeyParams() string

func (Aes256CtsHmacSha96) GetETypeID

func (e Aes256CtsHmacSha96) GetETypeID() int

func (Aes256CtsHmacSha96) GetHMACBitLength

func (e Aes256CtsHmacSha96) GetHMACBitLength() int

func (Aes256CtsHmacSha96) GetHashFunc

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

func (Aes256CtsHmacSha96) GetHashID

func (e Aes256CtsHmacSha96) GetHashID() int

func (Aes256CtsHmacSha96) GetKeyByteSize

func (e Aes256CtsHmacSha96) GetKeyByteSize() int

func (Aes256CtsHmacSha96) GetKeySeedBitLength

func (e Aes256CtsHmacSha96) GetKeySeedBitLength() int

func (Aes256CtsHmacSha96) GetMessageBlockByteSize

func (e Aes256CtsHmacSha96) GetMessageBlockByteSize() int

func (Aes256CtsHmacSha96) RandomToKey

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

func (Aes256CtsHmacSha96) StringToKey

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

func (Aes256CtsHmacSha96) VerifyChecksum

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

func (Aes256CtsHmacSha96) VerifyIntegrity

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

type Des3CbcSha1Kd

type Des3CbcSha1Kd struct {
}

func (Des3CbcSha1Kd) DecryptData

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

func (Des3CbcSha1Kd) DecryptMessage

func (e Des3CbcSha1Kd) DecryptMessage(key, ciphertext []byte, usage uint32) (message []byte, err error)

func (Des3CbcSha1Kd) DeriveKey

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

func (Des3CbcSha1Kd) DeriveRandom

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

func (Des3CbcSha1Kd) EncryptData

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

func (Des3CbcSha1Kd) EncryptMessage

func (e Des3CbcSha1Kd) EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error)

func (Des3CbcSha1Kd) GetChecksumHash

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

func (Des3CbcSha1Kd) GetConfounderByteSize

func (e Des3CbcSha1Kd) GetConfounderByteSize() int

func (Des3CbcSha1Kd) GetCypherBlockBitLength

func (e Des3CbcSha1Kd) GetCypherBlockBitLength() int

func (Des3CbcSha1Kd) GetDefaultStringToKeyParams

func (e Des3CbcSha1Kd) GetDefaultStringToKeyParams() string

func (Des3CbcSha1Kd) GetETypeID

func (e Des3CbcSha1Kd) GetETypeID() int

func (Des3CbcSha1Kd) GetHMACBitLength

func (e Des3CbcSha1Kd) GetHMACBitLength() int

func (Des3CbcSha1Kd) GetHashFunc

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

func (Des3CbcSha1Kd) GetHashID

func (e Des3CbcSha1Kd) GetHashID() int

func (Des3CbcSha1Kd) GetKeyByteSize

func (e Des3CbcSha1Kd) GetKeyByteSize() int

func (Des3CbcSha1Kd) GetKeySeedBitLength

func (e Des3CbcSha1Kd) GetKeySeedBitLength() int

func (Des3CbcSha1Kd) GetMessageBlockByteSize

func (e Des3CbcSha1Kd) GetMessageBlockByteSize() int

func (Des3CbcSha1Kd) RandomToKey

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

func (Des3CbcSha1Kd) StringToKey

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

func (Des3CbcSha1Kd) VerifyChecksum

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

func (Des3CbcSha1Kd) VerifyIntegrity

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

Directories

Path Synopsis
AES CipherText Stealing encryption and decryption methods
AES CipherText Stealing encryption and decryption methods
Encryption methods common across encryption types
Encryption methods common across encryption types
The Kerberos Encryption Type interface
The Kerberos Encryption Type interface
Encryption and checksum methods as specified in RFC 3961
Encryption and checksum methods as specified in RFC 3961
Encryption and checksum methods as specified in RFC 8009
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