bcrypt

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BCRYPT_MD5_ALGORITHM        = "MD5"
	BCRYPT_RNG_ALGORITHM        = "RNG"
	BCRYPT_SHA1_ALGORITHM       = "SHA1"
	BCRYPT_SHA256_ALGORITHM     = "SHA256"
	BCRYPT_SHA384_ALGORITHM     = "SHA384"
	BCRYPT_SHA512_ALGORITHM     = "SHA512"
	BCRYPT_ECDSA_P256_ALGORITHM = "ECDSA_P256"
	BCRYPT_ECDSA_P384_ALGORITHM = "ECDSA_P384"
	BCRYPT_ECDSA_P521_ALGORITHM = "ECDSA_P521"
)

Source: bcrypt.h

View Source
const (
	BCRYPT_ALGORITHM_NAME       = "AlgorithmName"
	BCRYPT_AUTH_TAG_LENGTH      = "AuthTagLength"
	BCRYPT_BLOCK_LENGTH         = "BlockLength"
	BCRYPT_BLOCK_SIZE_LIST      = "BlockSizeList"
	BCRYPT_CHAINING_MODE        = "ChainingMode"
	BCRYPT_EFFECTIVE_KEY_LENGTH = "EffectiveKeyLength"
	BCRYPT_HASH_BLOCK_LENGTH    = "HashBlockLength"
	BCRYPT_HASH_LENGTH          = "HashDigestLength"
	BCRYPT_HASH_OID_LIST        = "HashOIDList"
	BCRYPT_KEY_LENGTH           = "KeyLength"
	BCRYPT_KEY_LENGTHS          = "KeyLengths"
	BCRYPT_KEY_OBJECT_LENGTH    = "KeyObjectLength"
	BCRYPT_KEY_STRENGTH         = "KeyStrength"
	BCRYPT_OBJECT_LENGTH        = "ObjectLength"
	BCRYPT_PADDING_SCHEMES      = "PaddingSchemes"
	BCRYPT_PROVIDER_HANDLE      = "ProviderHandle"
	BCRYPT_SIGNATURE_LENGTH     = "SignatureLength"

	MS_PRIMITIVE_PROVIDER       = "Microsoft Primitive Provider"
	MS_PLATFORM_CRYPTO_PROVIDER = "Microsoft Platform Crypto Provider"

	BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION = 1

	BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG = 0x00000001

	BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG = 0x00000002

	BCRYPT_KEY_DATA_BLOB_VERSION1 = 1

	BCRYPT_RNG_USE_ENTROPY_IN_BUFFER = 0x00000001

	BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002

	BCRYPT_ALG_HANDLE_HMAC_FLAG = 0x00000008
)

Source: bcrypt.h

View Source
const (
	BCRYPT_PAD_NONE  = 0x00000001
	BCRYPT_PAD_PKCS1 = 0x00000002
	BCRYPT_PAD_OAEP  = 0x00000004
	BCRYPT_PAD_PSS   = 0x00000008
)

Source: bcrypt.h

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyMaterial added in v1.0.7

type KeyMaterial interface {
	Unmarshal(data []byte) (int, error)
	Marshal() ([]byte, error)
	Describe(indent int)
}

KeyMaterial is an interface that represents a key material in memory.

It provides methods for unmarshalling, marshalling, and comparing key materials.

func UnmarshalKeyMaterial added in v1.0.7

func UnmarshalKeyMaterial(data []byte) (KeyMaterial, int, error)

UnmarshalKeyMaterial unmarshals the key material from the provided byte slice.

Parameters: - data: A byte slice containing the raw key material to be parsed.

Returns: - A KeyMaterial object representing the key material. - An error if the unmarshalling fails, otherwise nil.

Note: The function expects the byte slice to follow the key material format, starting with the "KEY1" blob type identifier. It extracts the key type from the byte slice and stores it in the BCRYPT_KEY_BLOB structure.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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