Download the PHP package fpoirotte/tomcrypt without Composer

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

php_tomcrypt

PHP bindings for libtomcrypt.

Badges:

Why?

I made this extension for two reasons:

Installation

POSIX systems (Linux, etc.)

You can install this extension using pear:

wget https://github.com/fpoirotte/tomcrypt/archive/master.tar.gz tar zxvf master.tar.gz pear install tomcrypt-master/package.xml

It will also try to add the extension to your php.ini automatically. If it fails to do so, you can enable the extension manually by adding the following line to your php.ini:

extension=tomcrypt.so

Microsoft Windows

Download a pre-built php_tomcrypt.dll from the release page or compile the DLL yourself.

After that, just drop the DLL into you're PHP installation's extension_dir and add the following line of configuration to your php.ini:

extension=php_tomcrypt.dll

Usage

Encryption

Use code such as the following to encrypt some plaintext data:

The list of supported ciphers for your platform can be obtained through tomcrypt_list_ciphers(). This extension also provides constants which can be used to refer to the various ciphers:

The list of supported encryption/decryption modes can be retrieved through tomcrypt_list_modes(). The following constants are also provided:

TOMCRYPT_MODE_STREAM only works for stream ciphers (ie. TOMCRYPT_CIPHER_RC4, TOMCRYPT_CIPHER_CHACHA and TOMCRYPT_CIPHER_SOBER128). Likewise, these stream ciphers will not work with other modes.

Decryption

Decryption works pretty much the same way encryption does:

Of course, for decryption to work properly, the same algorithm (cipher), mode and secret key should be used during encryption and decryption.

Hashing

Hashing data can easily be done using the following code:

Use tomcrypt_list_hashes() to get a list of supported hashing algorithms. Like with ciphers, several constants are provided to refer to the various known hashing algorithms:

Message Authentication Codes

Generating a Message Authentication Code (MAC) can be done using the following code:

Use tomcrypt_list_macs() for a list of MAC algorithms supported by your platform. The following constants are also provided:

Most of these MAC algorithms require an additional algorithm to be given:

Please refer to the documentation on Hashing for more information about supported algorithms.

(Pseudo-)Random Number Generators

This extension can provide you with data generated at random, as an alternative to openssl_random_pseudo_bytes().

The following code can be used to generate (pseudo-)random number generators:

Various algorithms of (pseudo-)random number generators are available:

Apart from TOMCRYPT_RNG_SECURE --- which is the default RNG used by tomcrypt_rng_get_bytes(), all the other generators are only PRNGs and should not be used when truly random data is required.

It is also possible to export/import the state of a random number generator (eg. to reseed a PRNG between restarts of the PHP interpreter or to get predictable outputs from the PRNG):

Because TOMCRYPT_RNG_SECURE refers to the system's actual random number generator, it is not possible to export/import the state for that generator. Trying to do so will only result in an empty state being exported/imported.

Caveats

The following is a list of currently known problems:

License

libtomcrypt is released under a dual public domain / WTFPL license.

php_tomcrypt is released under version 3.01 of the PHP license.


All versions of tomcrypt with dependencies

PHP Build Version
Package Version
No informations.
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 fpoirotte/tomcrypt contains the following files

Loading the files please wait ....