Commit Graph

19 Commits

Author SHA1 Message Date
Stephen Paul Weber
d27d30a352
Implement encryptSecretKey
Allow encrypting a decrypted secret key, which is especially useful for
generating a new encrypted secret key.  Defaults to AES256, S2K
iter+salt SHA512, always uses s2k_useage 254 with sha1 integrity
protection of the encrypted key material.

Also add an example to parallel keygen.php that generates a key and then
encrypts it with a passphrase.
2019-09-10 21:31:06 -05:00
Meitar M
f8e0e997fc
Provide more guidance for understanding examples, update .travis.yml.
This commit adds an `example/README.md` file with a little bit of
guidance for running the examples themselves. This is helpful because
the examples all rely on the presence of a `phpseclib` installation
available to the PHP interpreter, and while there is a `composer.json`
file to this effect, none of the examples included the Composer
`autoload.php` file.

This commit makes no modifications to the example code itself, but does
`include_once()` the Composer autoload script so that `phpseclib` loads
and avoids causing a fatal error when a new user attempts to run the
examples to learn how to use the library.

This commit also updates the Travis `before_script` build script, dropping
the `--dev` argument to the `composer install` command. Current versions
of Composer emit a deprecation notice when `--dev` is passed.
2018-12-20 13:42:15 -07:00
Stephen Paul Weber
741fec24a6 These coefficients go in the other order 2016-07-26 20:09:15 -05:00
Stephen Paul Weber
cefaef242d Update normalise and example for clearsigning
Trailing whitespace must be removed when generating the signature and
must not be included in output.
2016-02-24 11:07:10 -05:00
Daniel Ruf
bcc9c920a0 fixed keygen example for the phpseclib 2.0 branch
Starting with phpseclib 2.0, it is fully namespaced and we have to use the fully qualified name.
2016-02-23 20:33:23 +01:00
Stephen Paul Weber
d37e91efda Example to serialize public key message 2015-11-16 10:40:44 -05:00
Stephen Paul Weber
055b5c5459 Add clearsign example 2015-07-04 16:14:42 -05:00
Stephen Paul Weber
775aa96118 Remove debug code 2014-06-28 11:38:14 -05:00
Stephen Paul Weber
6075d057d0 Use require_once in examples. 2013-09-14 11:41:46 -05:00
Stephen Paul Weber
82ed7d85bd Rename symmetric encrypt/decrypt class
I'm going to make this one more generic than one library, and have it
support ciphers based on what libraries are available, so this more
generic name is appropriate.
2013-09-14 11:36:58 -05:00
Stephen Paul Weber
e78424131e Any secret key
Spews warnings, but that's fine for now
2013-06-24 14:34:00 -05:00
Stephen Paul Weber
e27f9e236f Full example of decrypting a message 2013-06-24 11:22:01 -05:00
Stephen Paul Weber
58d1b5cee0 Clean up encryptDecrypt example 2013-06-24 11:20:46 -05:00
Stephen Paul Weber
cb9f918022 encrypt/decrypt example 2013-01-26 17:01:36 -05:00
Stephen Paul Weber
7d44211fc8 Clarify the verify example 2013-01-20 18:57:14 -05:00
Stephen Paul Weber
ae7454c504 Example code for generating a self-signed key 2011-07-25 15:15:40 -05:00
Stephen Paul Weber
1322f45ded revert broken example script 2011-07-25 12:01:26 -05:00
Stephen Paul Weber
af3643c919 crc24 was not encoded 2011-04-28 08:10:10 -05:00
Stephen Paul Weber
1f04075ef5 Example code on using the library 2011-04-23 09:20:17 -05:00