Using the php library - metahashorg/crypt_example_php GitHub Wiki
- simple installation
- additional files in the project folder
Dependencies
For ubuntu 14.x 16.x 18.x follow these steps:
First of all you need to install php repository with php 7.x :
- Install add-apt-repository scripts and add repo
sudo apt-get update
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update -y
Depends on your ubuntu version you should install python-software-properties (sudo apt -y install python-software-properties) or software-properties-common package (sudo apt -y install software-properties-common).
- Install php-7.2 with needed mondules
sudo apt-get install php7.2-cli php7.2-curl php7.2-dev php7.2-gmp
- Create a folder and unpack or clone this repository.
For example (using git)
cd ~
mkdir crypt_example_php
chmod 0777 crypt_example_php/
git clone https://github.com/metahashorg/crypt_example_php.git crypt_example_php/
- Open the created folder and follow the steps below.
For example
cd ~/crypt_example_php/
- Install
mdanter/ecclibrary
a) Install composer
For ubuntu 14.x
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
For ubuntu 16.x 18.x
sudo apt-get install composer
b) Install mdanter/ecc with composer
composer require mdanter/ecc:0.5.0
Note: if you receive error like "The zip extension and unzip command are both missing, skipping." you need to install zip/unzip:
sudo apt install zip unzip
Sample output:
Using version 0.5.0 for mdanter/ecc
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fgrosse/phpasn1 (2.0.1)
Downloading: 100%
- Installing mdanter/ecc (v0.5.0)
Downloading: 100%
fgrosse/phpasn1 suggests installing php-curl (For loading OID information from the web if they have not bee defined statically)
mdander/ecc will be install in vendor/ folder in current directory
- Create the folder
dataand set Read and Write permissions (unix chmod 0777)
For example
mkdir data
chmod 0777 data/