Documentation
¶
Index ¶
- Constants
- func QPPMinimumPads(qubits uint8) int
- func QPPMinimumSeedLength(qubits uint8) int
- type QuantumPermutationPad
- func (qpp *QuantumPermutationPad) CreatePRNG(seed []byte) *rand.Rand
- func (qpp *QuantumPermutationPad) Decrypt(data []byte)
- func (qpp *QuantumPermutationPad) DecryptWithPRNG(data []byte, rand *rand.Rand)
- func (qpp *QuantumPermutationPad) Encrypt(data []byte)
- func (qpp *QuantumPermutationPad) EncryptWithPRNG(data []byte, rand *rand.Rand)
- type Source
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 )
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, qubits uint8) *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) CreatePRNG ¶ added in v1.0.4
func (qpp *QuantumPermutationPad) CreatePRNG(seed []byte) *rand.Rand
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
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.Rand)
DecryptWithPRNG decrypts the data using the Quantum Permutation Pad with a custom PRNG This function shares the same permutation matrices
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.Rand)
EncryptWithPRNG encrypts the data using the Quantum Permutation Pad with a custom PRNG This function shares the same permutation matrices