Commit Graph

128 Commits

Author SHA1 Message Date
Deon George
358f28273c Updates to pass unit testing 2020-06-18 22:03:56 +10:00
Deon George
7d259b251f Move to more PSR-4 standards. 2020-06-17 22:44:51 +10:00
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
Stephen Paul Weber
67aba78699
Bump to 0.4.0 2019-08-01 13:11:09 -05:00
Stephen Paul Weber
fb671e183d Wordwrap enarmor output
Closes #74
2018-11-20 20:22:24 -05:00
Stephen Paul Weber
f43fbdc053 Put version into code
In case anyone wants to check it, I guess?

Closes #12
2018-07-25 20:18:44 -05:00
Stephen Paul Weber
752d80f14a S2K salt is *always* 8 bytes
Closes #33
2018-07-25 15:04:49 -05:00
Stephen Paul Weber
cba1ecce8a Do not rely on asserts for behaviour
Closes #35
2018-07-25 14:35:51 -05:00
Stephen Paul Weber
44e1bb2902 Do not throw when CAST5 unsupported
While this message may be more helpful, it will break some cases, such
as when there are multiple ciphers that could be used and we can just
skip CAST5 and move on.  Return NULL when CAST5 unsupported, just like
for other unsupported ciphers.
2018-07-25 14:08:00 -05:00
Stephen Paul Weber
43497a15c0 Use OpenSSL for CAST5
Mcrypt is deprecated, so use OpenSSL when we can, mcrypt when we can't.
2018-07-25 14:08:00 -05:00
Stephen Paul Weber
5a6b605710 Support Twofish and Blowfish 2018-07-25 14:07:16 -05:00
Stephen Paul Weber
498e60602b If session decryption fails, return NULL
Otherwise it returns false, we try to unpack that, and generally bad
things happen.
2018-07-25 09:57:33 -05:00
Stephen Paul Weber
413741fa84 Throw more helpful exception when already decrypted 2018-07-25 09:56:57 -05:00
Stephen Paul Weber
6006111bbc Bump version number 2017-04-12 16:23:15 -05:00
Jason Gallavin
cea5b176fc https://github.com/phpseclib/phpseclib/issues/1113
Add compatibility with phpseclib 2.0.3 - 2.0.4
2017-04-10 22:28:54 -04:00
Stephen Paul Weber
4531815ef2 The code in fact expects an array of OR'd bytes
As the spec specifies.

Closes #32
2016-07-26 19:21:57 -05:00
Stephen Paul Weber
de41f143e6 Throw exception if using CAST5 without mcrypt 2016-07-26 18:44:49 -05:00
Daniel Ruf
08ae2c57d1 use $cipher->key_length
starting with phpseclib 2.0.1, `key_size` was renamed to `key_length`
2016-03-14 12:10:17 +01: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
Vitaliy Solovey
ff4bd67e6b use phpseclib 2.0 2015-11-20 11:39:37 +02:00
Stephen Paul Weber
d37e91efda Example to serialize public key message 2015-11-16 10:40:44 -05:00
Stephen Paul Weber
f4fabd04e7 Merge pull request #9 from adecaneda/Partial-body-lengths
Support for Partial body lengths
2015-08-14 13:15:15 -05:00
adecaneda
cc52cb9dab Missing parameter in parse_old_format 2015-08-05 11:35:23 +02:00
adecaneda
4281c8fa97 Missing parameter 2015-08-05 11:18:28 +02:00
adecaneda
01a1f00edb Inclued partial body lengths
Partial body lengths based on https://github.com/toofishes/python-pgpdump/blob/master/pgpdump/packet.py
2015-08-05 10:54:57 +02:00
adecaneda
9bffda3ef2 Update openpgp_crypt_rsa.php
Typo in variable $p->encrypted_data
2015-07-31 11:12:17 +02:00
Hoffstadt
cb4fe9c632 Changed require Crypt/RSA.php to require_once
This change allows the lib usage with an autoloader.
2015-06-18 13:32:51 +02:00
Stephen Paul Weber
d6568d4925 Initial doxygen setup 2014-06-28 14:26:12 -05:00
Stephen Paul Weber
0262b038f1 Fix sign_key_userid 2014-06-28 12:27:25 -05:00
Stephen Paul Weber
d2913ccb8a Add support for CAST5 using mcrypt 2013-09-14 13:17:30 -05:00
Stephen Paul Weber
e1181bd25e Support for AES and 3DES are now optional 2013-09-14 11:45:49 -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
7ae4d539f2 Better errors for unsupported ciphers. 2013-09-14 11:28:35 -05:00
Stephen Paul Weber
26860d3b98 Always an MPI for RSA 2013-06-24 11:21:26 -05:00
Stephen Paul Weber
c341d7f09e Fix byte encoding of some packets 2013-06-24 11:21:10 -05:00
Stephen Paul Weber
05b757ab6c No index anymore 2013-02-24 18:11:22 -05:00
Stephen Paul Weber
3afd401688 Whitespace and proper padAmount 2013-02-24 18:11:11 -05:00
Stephen Paul Weber
04b89decd1 Should not throw away the version 2013-02-24 18:10:57 -05:00
Stephen Paul Weber
1ecb990a02 Use key_from_input as originally intended 2013-02-24 18:10:46 -05:00
Stephen Paul Weber
aab2a5e12b Data representation bugs in signature subpackets 2013-02-18 18:39:24 -05:00
Stephen Paul Weber
2a331f7403 better random string 2013-01-26 17:14:38 -05:00
Stephen Paul Weber
7d776fd605 Encryption support 2013-01-26 17:01:26 -05:00
Stephen Paul Weber
a56799955f Decrypt secret key 2013-01-26 14:55:51 -05:00
Stephen Paul Weber
cd15aec6f9 Asymmetric decryption 2013-01-26 14:00:00 -05:00
Stephen Paul Weber
641c07835b Support session keys 2013-01-26 11:26:55 -05:00
Stephen Paul Weber
8c60f4e37b Support the no-MDC (resync) case 2013-01-26 11:17:11 -05:00
Stephen Paul Weber
47a7f6e25c Keep trying on failure 2013-01-26 11:11:15 -05:00
Stephen Paul Weber
567b18c1b2 Support 3DES 2013-01-26 11:08:18 -05:00
Stephen Paul Weber
bf8201f432 Start work on decryption 2013-01-21 18:18:41 -05:00
Stephen Paul Weber
68b2047508 Both kinds of EncryptedDataPacket 2013-01-21 15:33:46 -05:00