Commit Graph

12 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
Stephen Paul Weber
752d80f14a S2K salt is *always* 8 bytes
Closes #33
2018-07-25 15:04:49 -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
413741fa84 Throw more helpful exception when already decrypted 2018-07-25 09:56: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
Vitaliy Solovey
ff4bd67e6b use phpseclib 2.0 2015-11-20 11:39:37 +02: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