# final class \SmartCipherCrypto
{ } ::

Class: Smart Cipher Crypto
Provides a built-in based feature to handle various encryption / decryption.

- Language: PHP
- Located at: lib/framework/lib_cryptoas.php
- Package: @Core:Crypto
- Namespace: \
- Class Name: SmartCipherCrypto
- Version: v.20231203
- Depends: classes: Smart, SmartEnvironment, SmartCryptoCiphersTwofishCBC, SmartCryptoCiphersBlowfishCBC, SmartCryptoCiphersOpenSSL, SmartCryptoCiphersHashCryptOFB, SmartDhKx
- Usage: static object: Class::method() - This class provides only STATIC methods

## class Methods

public static function t3f_encrypt ( string $data, string $key = "", bool $b2fpreenc = false ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
@param: {BOOL} $b2fpreenc: Default is FALSE ; If set to TRUE will pre-encrypt data using BF enc (v2)
Encrypts a string using the Threefish CBC 1024bit (v3 only)
This is intended to be used for high-sensitive persistent data (ex: data storage)
Ciphers: threefish.cbc (internal)
public static function t3f_decrypt ( string $data, string $key = "", bool $fallback2fb = false ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
@param: {BOOL} $fallback2fb: Default is FALSE ; If TRUE will try to fallback on TF / TF+BF / BF decrypt if signature is not recognized
Decrypts a string using the Threefish CBC 1024bit (v3 only)
This is intended to be used for high-sensitive persistent data (ex: data storage)
Ciphers: threefish.cbc (internal)
public static function tf_encrypt ( string $data, string $key = "", bool $bfpreenc = false ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
@param: {BOOL} $bfpreenc: Default is FALSE ; If set to TRUE will pre-encrypt data using BF enc (v3)
Encrypts a string using the Twofish CBC 256bit (v3 only)
This is intended to be used for high-sensitive persistent data (ex: data storage)
Ciphers: twofish.cbc (internal)
public static function tf_decrypt ( string $data, string $key = "", bool $fallbackbf = false ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
@param: {BOOL} $fallbackbf: Default is FALSE ; If TRUE will try to fallback on BF decrypt if signature is not recognized
Decrypts a string using the Twofish CBC 256bit (v3 only)
This is intended to be used for high-sensitive persistent data (ex: data storage)
Ciphers: twofish.cbc (internal)
public static function bf_encrypt ( string $data, string $key = "" ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
Encrypts a string using the Blowfish CBC 448bit (v3 only)
This is intended to be used for persistent data (ex: data storage)
Ciphers: blowfish.cbc (internal)
public static function bf_decrypt ( string $data, string $key = "" ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
Decrypts a string using the Blowfish CBC 448bit (v3 or v2 / v1 backward compatible)
This is intended to be used for persistent data (ex: data storage)
Ciphers: blowfish.cbc (internal)
public static function encrypt ( string $data, string $key = "", string $cipher = "" ) {} :: STRING
@return: {STRING} The encrypted data as B64S or empty string on error
@param: {STRING} $data: The plain data to be encrypted
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
@param: {ENUM} $cipher: Selected cipher: hash/{mode}, blowfish.cbc, openssl/{cipher}/{mode} ; If no cipher is provided will use the default cipher
Encrypts data on-the-fly using various Ciphers
This is intended to be used for non-persistent data ; these ciphers may change or dissapear over time
public static function decrypt ( string $data, string $key = "", string $cipher = "" ) {} :: STRING
@return: {STRING} The plain (decrypted) data or empty string on error
@param: {STRING} $data: The encrypted data
@param: {STRING} $key: The encryption key (secret) ; must be between 7 and 4096 bytes ; If no key is provided will use the internal key from init: SMART_FRAMEWORK_SECURITY_KEY
@param: {ENUM} $cipher: Selected cipher: hash/{mode}, blowfish.cbc, openssl/cipher/mode ; ; If no cipher is provided will use the default cipher
Decrypts data on-the-fly using various Ciphers
This is intended to be used for non-persistent data ; these ciphers may change or dissapear over time

## class Properties

## class Constants

## Sample code: PHP

`

    <?php

    // Usage example:
     SmartCipherCrypto::some_method_of_this_class(...);

    // #end php code

`

documentation generated on: 2024-12-16 16:53:44 +0000

Smart.Framework © 2009-2024 unix-world.org