LeKoala\Encrypt\EncryptHelper
Synopsis
class EncryptHelper
{
- // constants
- const DEFAULT_OUTPUT_SIZE = 15;
- const DEFAULT_DOMAIN_SIZE = 127;
- const BORING = "brng";
- const MODERN = "nacl";
- const FIPS = "fips";
- // members
- private static $forced_encryption = NULL;
- private static bool $automatic_rotation = true;
- private static boolean $automatic_decryption = true;
- private static string $aad_source = "ID";
- protected static CipherSweet $ciphersweet;
- protected static EncryptedFile $encryptedFile;
- protected static array $field_cache = ;
- // methods
- public static string getForcedEncryption()
- public static void setForcedEncryption()
- public static bool getAutomaticRotation()
- public static void setAutomaticRotation()
- public static bool getAutomaticDecryption()
- public static void setAutomaticDecryption()
- public static string getAadSource()
- public static void setAadSource()
- public static array planIndexSizes()
- public static array planIndexSizesForClass()
- public static array removeNulls()
- public static string generateKey()
- public static array generateKeyPair()
- public static string getKey()
- public static string getOldKey()
- public static StringProvider getProviderWithKey()
- public static BackendInterface getRecommendedBackend()
- public static BackendInterface getBackendForEncryption()
- public static CipherSweet getEngineForEncryption()
- public static CipherSweet getEngine()
- public static CipherSweet getEngineWithProvider()
- public static EncryptedFile getEncryptedFileInstance()
- public static bool checkIfFileIsEncrypted()
- public static CipherSweet getCipherSweet()
- public static void clearCipherSweet()
- public static BackendInterface getCipherSweetBackend()
- public static boolean isEncrypted()
- public static boolean isFips()
- public static boolean isNacl()
- public static boolean isBoring()
- public static string getEncryption()
- public static boolean isEncryptedField()
- protected static string filterDbClass()
- public static array getEncryptedFields()
- public static string encrypt()
- public static string decrypt()
- public static array mapEncryptionDBField()
- public static float coincidenceCount()
- public static void sendEncryptedFile()
- public static void sendDecryptedFile()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
DEFAULT_OUTPUT_SIZE | 15 |
DEFAULT_DOMAIN_SIZE | 127 |
BORING | "brng" |
MODERN | "nacl" |
FIPS | "fips" |
Members
private
- $aad_source — string
- $automatic_decryption — boolean
- $automatic_rotation — LeKoala\Encrypt\bool
- $forced_encryption — string
protected
- $ciphersweet — ParagonIE\CipherSweet\CipherSweet
- $encryptedFile — ParagonIE\CipherSweet\EncryptedFile
- $field_cache — array
Methods
protected
- filterDbClass() — Filters parameters from database class config
public
- checkIfFileIsEncrypted()
- clearCipherSweet()
- coincidenceCount() — Compute Blind Index Information Leaks
- decrypt() — A simple decryption
- encrypt() — A simple encryption
- generateKey() — Attempting to pass a key of an invalid size (i.e. not 256-bit) will result in a CryptoOperationException being thrown.
- generateKeyPair()
- getAadSource()
- getAutomaticDecryption()
- getAutomaticRotation() — This would only work if you changed from algorithm
- getBackendForEncryption()
- getCipherSweet()
- getCipherSweetBackend()
- getEncryptedFields()
- getEncryptedFileInstance()
- getEncryption()
- getEngine()
- getEngineForEncryption()
- getEngineWithProvider()
- getForcedEncryption()
- getKey() — Get app encryption key Encryption key should be provided in your $_ENV or .env file
- getOldKey()
- getProviderWithKey()
- getRecommendedBackend()
- isBoring()
- isEncrypted() — Check if a value is encrypted
- isEncryptedField() — Check if a field is encrypted on a class This relies on a field class starting with Encrypted
- isFips()
- isNacl()
- mapEncryptionDBField() — Return a map of fields with their encrypted counterpart
- planIndexSizes()
- planIndexSizesForClass()
- removeNulls()
- sendDecryptedFile() — Send a decrypted file
- sendEncryptedFile() — Alias of sendDecryptedFile
- setAadSource()
- setAutomaticDecryption()
- setAutomaticRotation()
- setForcedEncryption()