Download the PHP package php101/php101 without Composer

On this page you can find all versions of the php package php101/php101. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php101

SecureVault Class Documentation

The SecureVault class provides functionality for encrypting data, generating digital signatures, and working with encrypted files. It utilizes the sodium_crypto_secretbox encryption algorithm and the Firebase\JWT\JWT library for digital signature generation and verification.

Class Methods:

  1. cipher(string $value, string $key): string

    • Encrypts the given string using the provided key.
    • Parameters:
      • $value (string): The string to be encrypted.
      • $key (string): The encryption key.
    • Returns:
      • Encrypted string.
  2. deCipher(string $cipher, string $key): mixed

    • Decrypts the encrypted string and returns the original plaintext string.
    • Parameters:
      • $cipher (string): The encrypted string to be decrypted.
      • $key (string): The decryption key.
    • Returns:
      • The decrypted plaintext string or false if decryption fails.
  3. retrieveJWTFromFile(string $data): string|bool

    • Retrieves the JWT (JSON Web Token) from the given file content.
    • Parameters:
      • $data (string): The content of the encrypted file.
    • Returns:
      • The JWT if found in the content, or false if not found.
  4. fileDecipher(string $file, string $key): array|bool

    • Decrypts the content of an encrypted file and returns the deciphered data as an array.
    • Parameters:
      • $file (string): The path to the encrypted file.
      • $key (string): The decryption key.
    • Throws:
      • Exception if the file does not exist, has an invalid name format, or contains invalid JSON content.
    • Returns:
      • The deciphered data as an array if decryption and verification are successful, or false otherwise.
  5. verifySignature(string $fileContent, string $jwt, string $secreteKey): bool

    • Verifies the digital signature of the file content using the provided JWT and secret key.
    • Parameters:
      • $fileContent (string): The content of the encrypted file.
      • $jwt (string): The JSON Web Token (JWT) to be verified.
      • $secreteKey (string): The secret key used for verification.
    • Returns:
      • True if the signature is valid, false otherwise.
  6. generateSignature(string $data, string $key, array $extra = []): string

    • Generates a digital signature (JWT) for the given data using the provided key.
    • Parameters:
      • $data (string): The data to be signed.
      • $key (string): The key used for signing.
      • $extra (array): Additional data to include in the signature payload. (Optional)
    • Returns:
      • The generated digital signature (JWT) as a string.
  7. encryptToFile(array $fileContent, string $key, string $dir = DIR, string $prefix = 'config_'): bool|int
    • Encrypts the provided file content, generates a digital signature, and writes it to a file.
    • Parameters:
      • $fileContent (array): The data to be encrypted and written to the file.
      • $key (string): The encryption key.
      • $dir (string): The directory where the encrypted file should be stored. (Optional)
      • $prefix (string): The prefix to be added to the file name. (Optional)
    • Throws:
      • Exception if the given directory is not a valid directory.
      • Exception if encryption or signature generation fails.
    • Returns:
      • The number of bytes written to the file on success, or false if an error occurs.

Additional Notes:

For more information, please refer to the class documentation and code comments.


All versions of php101 with dependencies

PHP Build Version
Package Version
Requires phpmailer/phpmailer Version ^6.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package php101/php101 contains the following files

Loading the files please wait ...