kubernetesk8s.io/kubernetes/cmd/kubeadm/app/util/crypto Index | Files

package crypto

import "k8s.io/kubernetes/cmd/kubeadm/app/util/crypto"

Index

Functions

func CreateRandBytes

func CreateRandBytes(size uint32) ([]byte, error)

CreateRandBytes returns a cryptographically secure slice of random bytes with a given size

func DecryptBytes

func DecryptBytes(data, key []byte) ([]byte, error)

DecryptBytes takes a byte slice of encrypted data and an encryption key and returns a decrypted byte slice of data. The key must be an AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256

func EncryptBytes

func EncryptBytes(data, key []byte) ([]byte, error)

EncryptBytes takes a byte slice of raw data and an encryption key and returns an encrypted byte slice of data. The key must be an AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256

Source Files

crypto.go

Version
v1.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
5 hours ago

Tools for package owners.