CryptexTest
extends TestCase
in package
FinalYes
Table of Contents
Properties
- $ciphertext : string
- $key : string
- $plaintext : string
- $salt : string
Methods
- invalidCiphertextProvider() : array<string, array{mixed}>
- invalidKeyProvider() : array<string, array{mixed}>
- invalidPlaintextProvider() : array<string, array{mixed}>
- invalidSaltLengthProvider() : array<string, array{string}>
- invalidSaltTypeProvider() : array<string, array{mixed}>
- testDecryptRejectsInvalidCiphertextTypes() : void
- testDecryptRejectsInvalidKeyTypes() : void
- testDecryptRejectsInvalidSaltLength() : void
- testDecryptRejectsInvalidSaltTypes() : void
- testDecryptRejectsMalformedHexCiphertext() : void
- testDecryptRejectsNonceOnlyPayload() : void
- testDecryptRejectsNoncePlusTooShortTagPayload() : void
- testDecryptRejectsOddLengthHexCiphertext() : void
- testDecryptRejectsTamperedAuthenticationTag() : void
- testDecryptRejectsTamperedCiphertext() : void
- testDecryptRejectsTamperedNonce() : void
- testDecryptRejectsTooShortPayload() : void
- testDecryptRejectsWrongKey() : void
- testDecryptRejectsWrongSalt() : void
- testDecryptsFixedLegacyV4Ciphertext() : void
- testDecryptValidatesSaltBeforeCiphertext() : void
- testEncryptDecryptBinaryPlaintext() : void
- testEncryptDecryptEmptyPlaintext() : void
- testEncryptDecryptLargePlaintext() : void
- testEncryptDecryptNonAsciiPlaintext() : void
- testEncryptDecryptRoundTrip() : void
- testEncryptRejectsInvalidKeyTypes() : void
- testEncryptRejectsInvalidPlaintextTypes() : void
- testEncryptRejectsInvalidSaltLength() : void
- testEncryptRejectsInvalidSaltTypes() : void
- testGenerateSaltReturnsExpectedLength() : void
- testRepeatedEncryptionProducesDifferentCiphertext() : void
- setUp() : void
- flipDecodedByte() : string
Properties
$ciphertext
private
string
$ciphertext
$key
private
string
$key
$plaintext
private
string
$plaintext
$salt
private
string
$salt
Methods
invalidCiphertextProvider()
public
static invalidCiphertextProvider() : array<string, array{mixed}>
Return values
array<string, array{mixed}>invalidKeyProvider()
public
static invalidKeyProvider() : array<string, array{mixed}>
Return values
array<string, array{mixed}>invalidPlaintextProvider()
public
static invalidPlaintextProvider() : array<string, array{mixed}>
Return values
array<string, array{mixed}>invalidSaltLengthProvider()
public
static invalidSaltLengthProvider() : array<string, array{string}>
Return values
array<string, array{string}>invalidSaltTypeProvider()
public
static invalidSaltTypeProvider() : array<string, array{mixed}>
Return values
array<string, array{mixed}>testDecryptRejectsInvalidCiphertextTypes()
public
testDecryptRejectsInvalidCiphertextTypes(mixed $ciphertext) : void
Parameters
- $ciphertext : mixed
Attributes
- #[DataProvider]
- 'invalidCiphertextProvider'
testDecryptRejectsInvalidKeyTypes()
public
testDecryptRejectsInvalidKeyTypes(mixed $key) : void
Parameters
- $key : mixed
Attributes
- #[DataProvider]
- 'invalidKeyProvider'
testDecryptRejectsInvalidSaltLength()
public
testDecryptRejectsInvalidSaltLength(string $salt) : void
Parameters
- $salt : string
Attributes
- #[DataProvider]
- 'invalidSaltLengthProvider'
testDecryptRejectsInvalidSaltTypes()
public
testDecryptRejectsInvalidSaltTypes(mixed $salt) : void
Parameters
- $salt : mixed
Attributes
- #[DataProvider]
- 'invalidSaltTypeProvider'
testDecryptRejectsMalformedHexCiphertext()
public
testDecryptRejectsMalformedHexCiphertext() : void
testDecryptRejectsNonceOnlyPayload()
public
testDecryptRejectsNonceOnlyPayload() : void
testDecryptRejectsNoncePlusTooShortTagPayload()
public
testDecryptRejectsNoncePlusTooShortTagPayload() : void
testDecryptRejectsOddLengthHexCiphertext()
public
testDecryptRejectsOddLengthHexCiphertext() : void
testDecryptRejectsTamperedAuthenticationTag()
public
testDecryptRejectsTamperedAuthenticationTag() : void
testDecryptRejectsTamperedCiphertext()
public
testDecryptRejectsTamperedCiphertext() : void
testDecryptRejectsTamperedNonce()
public
testDecryptRejectsTamperedNonce() : void
testDecryptRejectsTooShortPayload()
public
testDecryptRejectsTooShortPayload() : void
testDecryptRejectsWrongKey()
public
testDecryptRejectsWrongKey() : void
testDecryptRejectsWrongSalt()
public
testDecryptRejectsWrongSalt() : void
testDecryptsFixedLegacyV4Ciphertext()
public
testDecryptsFixedLegacyV4Ciphertext() : void
testDecryptValidatesSaltBeforeCiphertext()
public
testDecryptValidatesSaltBeforeCiphertext() : void
testEncryptDecryptBinaryPlaintext()
public
testEncryptDecryptBinaryPlaintext() : void
testEncryptDecryptEmptyPlaintext()
public
testEncryptDecryptEmptyPlaintext() : void
testEncryptDecryptLargePlaintext()
public
testEncryptDecryptLargePlaintext() : void
testEncryptDecryptNonAsciiPlaintext()
public
testEncryptDecryptNonAsciiPlaintext() : void
testEncryptDecryptRoundTrip()
public
testEncryptDecryptRoundTrip() : void
testEncryptRejectsInvalidKeyTypes()
public
testEncryptRejectsInvalidKeyTypes(mixed $key) : void
Parameters
- $key : mixed
Attributes
- #[DataProvider]
- 'invalidKeyProvider'
testEncryptRejectsInvalidPlaintextTypes()
public
testEncryptRejectsInvalidPlaintextTypes(mixed $plaintext) : void
Parameters
- $plaintext : mixed
Attributes
- #[DataProvider]
- 'invalidPlaintextProvider'
testEncryptRejectsInvalidSaltLength()
public
testEncryptRejectsInvalidSaltLength(string $salt) : void
Parameters
- $salt : string
Attributes
- #[DataProvider]
- 'invalidSaltLengthProvider'
testEncryptRejectsInvalidSaltTypes()
public
testEncryptRejectsInvalidSaltTypes(mixed $salt) : void
Parameters
- $salt : mixed
Attributes
- #[DataProvider]
- 'invalidSaltTypeProvider'
testGenerateSaltReturnsExpectedLength()
public
testGenerateSaltReturnsExpectedLength() : void
testRepeatedEncryptionProducesDifferentCiphertext()
public
testRepeatedEncryptionProducesDifferentCiphertext() : void
setUp()
protected
setUp() : void
flipDecodedByte()
private
flipDecodedByte(string $hex, int $offset) : string
Parameters
- $hex : string
- $offset : int