Download the PHP package nabeghe/simple-cipher without Composer

On this page you can find all versions of the php package nabeghe/simple-cipher. 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 simple-cipher

Simple Cipher for PHP

A simple cipher using OpenSSL with a few additional tweaks.

Implementing a cipher to encrypt and decrypt your data can be a bit tricky, but with OpenSSL, it's a breeze. However, this library combines several techniques to give you a simple yet effective way to handle encryption and decryption. You don’t even need to set a secret or password for your cipher system! If you don’t specify one, a default value is used that’s unique and remains constant throughout the program, except in special cases. However, it's not recommended

The best part? You'll be working with a SimpleCipher class here, where its methods are accessible both statically and through object instances. Data is returned in the same type it was encrypted with, ensuring consistency. but objects converted into arrays, and you also have the option to set a default value in case there’s an issue with decryption.


🫡 Usage

🚀 Installation

You can install the package via composer:


Configuration

The configuration can be an array, string, number, or null. A string or number means setting the secret (password), null means using default values, and an array allows for setting each option separately.

Array Syntax:

Optiona name Description
algo The cipher method.
Default: aes-256-gcm
secret The cipher secret (password).
Default: A random value is generated at the start & stored in a file within the library's directory. However, the priority is first given to a constant named SIMPLE_CIPHER_SECRET, , and then to an environment key with the same name in $_ENV.
default A default value is used in case there’s an issue in the decryption process, which is null if not set.

Static Mode

Syntax:

Example:


Instance Mode

Syntax:

Example:


📖 License

Copyright (c) 2024 Hadi Akbarzadeh

Licensed under the MIT license, see LICENSE.md for details.


All versions of simple-cipher with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-openssl Version *
ext-json Version *
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 nabeghe/simple-cipher contains the following files

Loading the files please wait ....