Documentation
¶
Index ¶
Constants ¶
const ( // KeySize is the size of AES-256 keys in bytes KeySize = 32 // NonceSize is the size of AES-GCM nonces in bytes NonceSize = 12 // SaltSize is the size of PBKDF2 salts in bytes SaltSize = 32 // PBKDF2Iterations is the number of iterations for key derivation PBKDF2Iterations = 100000 // KyberPublicKeySize is the size of Kyber public keys KyberPublicKeySize = 32 // KyberSecretKeySize is the size of Kyber secret keys KyberSecretKeySize = 32 // KyberCiphertextSize is the size of Kyber ciphertexts KyberCiphertextSize = 32 )
Variables ¶
var ( // Suite is the cryptographic suite we use for post-quantum operations Suite = edwards25519.NewBlakeSHA256Ed25519() )
Functions ¶
func DeriveColumnKey ¶
DeriveColumnKey derives a column-specific key from master key and column name
func LoadPlugin ¶ added in v0.3.0
LoadPlugin dynamically loads a module from a Go plugin. The plugin must expose a symbol named "Module" that implements Module.
func RegisterModule ¶ added in v0.3.0
func RegisterModule(m Module)
RegisterModule registers a cryptographic module.
Types ¶
type ColumnEncryptor ¶
type ColumnEncryptor struct {
// PQ components
KyberPublicKey kyber.Point
KyberSecretKey kyber.Scalar
// contains filtered or unexported fields
}
ColumnEncryptor handles encryption/decryption for column data
func NewColumnEncryptor ¶
func NewColumnEncryptor(key []byte) (*ColumnEncryptor, error)
NewColumnEncryptor creates a new column encryptor with hybrid encryption
func (*ColumnEncryptor) Decrypt ¶
func (ce *ColumnEncryptor) Decrypt(ciphertext []byte) ([]byte, error)
Decrypt decrypts data using hybrid classical + post-quantum decryption
func (*ColumnEncryptor) Encrypt ¶
func (ce *ColumnEncryptor) Encrypt(plaintext []byte) ([]byte, error)
Encrypt encrypts data using hybrid classical + post-quantum encryption
type Encryptor ¶ added in v0.3.0
type Encryptor interface {
Encrypt([]byte) ([]byte, error)
Decrypt([]byte) ([]byte, error)
Sign([]byte) ([]byte, error)
Verify([]byte, []byte) (bool, error)
}
Encryptor defines encryption operations used by the rest of the system.
type Key ¶
type Key struct {
Data []byte
Salt []byte
// PQ components
KyberPublicKey kyber.Point
KyberSecretKey kyber.Scalar
}
Key represents an encryption key with associated metadata
type Module ¶ added in v0.3.0
type Module interface {
Name() string
NewKey(password string) (*Key, error)
DeriveKey(password string, salt []byte) *Key
NewEncryptor(key []byte) (Encryptor, error)
}
Module provides cryptographic primitives. Different modules can implement alternative algorithms such as homomorphic encryption.