Documentation
¶
Index ¶
Constants ¶
const ( PAD_IDENTIFIER = "QPP_%b" PM_SELECTOR_IDENTIFIER = "PERMUTATION_MATRIX_SELECTOR" SHUFFLE_SALT = "___QUANTUM_PERMUTATION_PAD_SHUFFLE_SALT___" PRNG_SALT = "___QUANTUM_PERMUTATION_PAD_PRNG_SALT___" NATIVE_BYTE_LENGTH = 8 // Bit length for native byte PBKDF2_LOOPS = 128 // Number of iterations for PBKDF2 CHUNK_DERIVE_SALT = "___QUANTUM_PERMUTATION_PAD_SEED_DERIVE___" CHUNK_DERIVE_LOOPS = 1024 PAD_SWITCH = 8 // switch pad for every PAD_SWITCH bytes QUBITS = 8 // number of quantum bits of this implementation )
Constants used in Quantum Permutation Pad (QPP) for identifiers, salts, and configuration
Variables ¶
This section is empty.
Functions ¶
func QPPMinimumPads ¶ added in v1.1.4
QPPMinimumPads calculates the minimum number of pads required based on the number of qubits This is derived from the minimum seed length needed for the permutations
func QPPMinimumSeedLength ¶ added in v1.1.4
QPPMinimumSeedLength calculates the length required for the seed based on the number of qubits This ensures that the seed has sufficient entropy for the required permutations
Types ¶
type QuantumPermutationPad ¶
type QuantumPermutationPad struct {
// contains filtered or unexported fields
}
QuantumPermutationPad represents the encryption/decryption structure using quantum permutation pads QPP is a cryptographic technique that leverages quantum-inspired permutation matrices to provide secure encryption.
func NewQPP ¶
func NewQPP(seed []byte, numPads uint16) *QuantumPermutationPad
NewQPP creates a new Quantum Permutation Pad instance with the provided seed, number of pads, and qubits The seed is used to generate deterministic pseudo-random number generators (PRNGs) for both encryption and decryption
func (*QuantumPermutationPad) Decrypt ¶
func (qpp *QuantumPermutationPad) Decrypt(data []byte)
Decrypt decrypts the given data using the Quantum Permutation Pad with the default PRNG It selects a reverse permutation matrix based on a random index and uses it to restore each byte of the data
func (*QuantumPermutationPad) DecryptWithPRNG ¶ added in v1.0.4
func (qpp *QuantumPermutationPad) DecryptWithPRNG(data []byte, rand *Rand)
DecryptWithPRNG mirrors EncryptWithPRNG but walks the reverse permutation pads so that the cipher stream remains synchronized with the same PRNG state.
func (*QuantumPermutationPad) Encrypt ¶
func (qpp *QuantumPermutationPad) Encrypt(data []byte)
Encrypt encrypts the given data using the Quantum Permutation Pad with the default PRNG It selects a permutation matrix based on a random index and uses it to permute each byte of the data
func (*QuantumPermutationPad) EncryptWithPRNG ¶ added in v1.0.4
func (qpp *QuantumPermutationPad) EncryptWithPRNG(data []byte, rand *Rand)
EncryptWithPRNG encrypts the data using the Quantum Permutation Pad with a custom PRNG The PRNG exposes 64-bit chunks; the `count` field tracks how many bytes of the current 64-bit word have already been consumed so that successive calls remain byte-aligned even if the caller streams arbitrary lengths.
type Rand ¶ added in v1.1.7
type Rand struct {
// contains filtered or unexported fields
}
Rand is a stateful random number generator
func CreatePRNG ¶ added in v1.1.18
CreatePRNG creates a deterministic pseudo-random number generator based on the provided seed It uses HMAC and PBKDF2 to derive a random seed for the PRNG