vsn/ssf

VSN Secure Signture Format for PHP 5.6

dev-main 2003-01-29 20:22 UTC

This package is auto-updated.

Last update: 2024-10-29 06:00:28 UTC


README

Copyright © Tyler R. Drury 28-04-2022, All Rights Reserved

Proudly Canadian, made in Ontario

vsn\ssf-cli.phar is a PHP 5.6 archive which contains Object oriented APIs for PHP resource types and global functions such as:

  • encoding SSF 32 and 64 Byte signatures
  • deconding SSF 32 and 64 Byte signatures
  • verifying SSF 32 and 64 Byte signatures

License

ssf-cli.phar is released under the Apache 2.0 License typical of all VSN products.

See LICENSE file for details.

Installation

using composer

The offical PHP CLI package is available via Composer here

or by running the following in the console (assuming both PHP and Composer have been installed locally)

>composer require vsn/ssf

or by adding vsn/ssf to your own project composer.json require section

then running

>composer update

using github

Access this URL in browser to clone the repo directly

https://github.com/vigilance91/ssf-cli-php56.git

or install using GithubCLI

>gh repo clone vigilance91/ssf-cli-php56

Or simply

  • download vsn\ssf-cli-php56™ PHAR from the offical website
  • download the latest stable version via the offcial FTPS server
  • download the official compressed package (.gz) from IPFS

Use

After installation, the PHAR may be executed from anywhere on a machine

>cd C:/some/directory
>%php5% C:/phars/ssf-cli/run.php --d=3 --v --A

or, if the archive is installed in a main project's sub-directory:

>cd C:/some/directory
>%php5% build/run.php --d=3 --v --A

Or, if the PHP interpreter and the local directory containg all downloaded PHARS have been added to the default system PATH variable, the leading call to the php interpreter can be omitted as follows

>php %PHAR_DIR%/ssf-cli/run.php --d=3 --v --A
  • DEBUG installs are for the most recent developer builds (alphas) only, as such, all distributable PHARs lack any debug functionality and enabling quiet mode hides the header, footer and menu displays (if --A is provides as well)
  • All DEBUG installs are dependent upon the chrono module for low-level, high accuracy code execution profiling
  • Note that if debugging a script executing on a server, use of xdebug (for live server debugging) requires PHP 7.1+ as well as a manually compiled PHP interpreter, with the xdebug Zend extension installed and a compatible IDE (with appropriate extensions)

Ensure all additional desired/required modules have been installed.

Output an unsigned packed SSF32 to the console, outputting as hex

>php build/run.php --M=encode --F=str
    --source="hello world"
    --hex

Encode an unsigned packed SSF32, outputting to the console as base64

>php build/run.php --M=encode --F=str
    --source="hello world"
    --base64

Encode an signed packed SSF32, outputting to the console as hex

>php build/run.php --M=encode --F=str
    --source="hello world"
    --privateKey=pathToPrivateKey.key
    --password=yourPasswordHere
    --hex

Write SSF encoded string to file

>php build/run.php --M=encode --F=stf
    --source="hello world"
    --O="_output/tmpPackedUnsinged.ssf32"
    --hex --v --d=3

Optionally, instead of using the -F stf, --O, --v and --d options can be omitted and the shell's pipe operator can be used to write the output (assuming there is no other output, errors, exceptions, etc, than what is output at exection termination), option -F str can be used similar to bellow:

>php build/run.php --M=encode --F=str
    --source="hello world"
    --hex > _output/tmpPackedUnsinged.hex.ssf32

Verify --source as a base64 encoded Unsigned SSF.

>php build/run.php -M verify --F=f
    --source="hello world"
    --ssf="I1NTRg0KGgqcgTTO8t+o6YGHEdqa/hDg2kjcp1jKhm66jUffJYR89Ec9fYM0P7fgOPQvfccOAYxScHP08mG8NdfcXDfIlUDBAAABQLlNJ7mTTT4IpS5S19p9q/rEhO/jelOA7pCI96zi783pSzJ0jfVOQaCUZUsMyoj3dgqKzOKwWPUatmlWE/W4N2W3w6rTJQPQTISFOECbnzUuYaWZVeVOu3g6dEdksH5JL3eX97R/uaC3lW/FFykYHY01oxf6hB/qXE1F3c6irjOiaQITZ+D6S0v7qgyvAxFdtmgRCLSVAMgI74rXrpoWAT7QnM6MSk740c/fG23iDvXKK5I7aqfVl1iLUBo4Jd8B+rhTSeOiHYdZZNbiwfdQ22ZyHu+JbmNtpRMQ7TesjOZW+SPMI009rK1KPOFW3Uqp4KJMlszQjn3tkWRlZhjnIvhpmzGIP2/JMi8weaSEd5yTIkRAIVUTCnJp1yboZSUW85dlVmXIfhMYm4wJyF7rDSHSobaG5agPMFOQETf0UUt4"
    --base64

Note: If the option argument does not contain whitespace quotes can be omitted. If the argument is a file path or URL, it is recommended to urlencode the value if the value contains whitespace or other characters needing escaped while also omitting the quottion marks.

>php build/run.php -M verify --F=f
    --v --d=3 --base64 
    --privateKey="C:/path/to/rsaPrivateKey.key"
    --password="replaceWithYourPrivteKeyPassword"
    --source="_output/helloWorld.txt"
    --ssf="I1NTRg0KGgqcgTTO8t+o6YGHEdqa/hDg2kjcp1jKhm66jUffJYR89Ec9fYM0P7fgOPQvfccOAYxScHP08mG8NdfcXDfIlUDBAAABQLlNJ7mTTT4IpS5S19p9q/rEhO/jelOA7pCI96zi783pSzJ0jfVOQaCUZUsMyoj3dgqKzOKwWPUatmlWE/W4N2W3w6rTJQPQTISFOECbnzUuYaWZVeVOu3g6dEdksH5JL3eX97R/uaC3lW/FFykYHY01oxf6hB/qXE1F3c6irjOiaQITZ+D6S0v7qgyvAxFdtmgRCLSVAMgI74rXrpoWAT7QnM6MSk740c/fG23iDvXKK5I7aqfVl1iLUBo4Jd8B+rhTSeOiHYdZZNbiwfdQ22ZyHu+JbmNtpRMQ7TesjOZW+SPMI009rK1KPOFW3Uqp4KJMlszQjn3tkWRlZhjnIvhpmzGIP2/JMi8weaSEd5yTIkRAIVUTCnJp1yboZSUW85dlVmXIfhMYm4wJyF7rDSHSobaG5agPMFOQETf0UUt4"

Note:Quotation marks around string arguments are optional, unless the value contains whitespace or other escape characters.

>php build/run.php -M verify --F=str
    --v --d=3 --base64 
    --privateKey=C%3A%2Fpath%2Fto%2FrsaPrivateKey.key
    --password=replaceWithYourPrivteKeyPassword
    --source=.%2F_output%2FhelloWorld.txt
    --ssf=I1NTRg0KGgpskEqXGkFC0z9JaYtHC8MEOzfdU7tJvJMCSbkRuprJ4Uc9fYM0P7fgOPQvfccOAYxScHP08mG8NdfcXDfIlUDBAAAAILlNJ7mTTT4IpS5S19p9q/rEhO/jelOA7pCI96zi783p

Links

The official, most recent and stable version of the VS CLI PHAR libraries for development use are hosted here:

Additional Links