1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-12-02 17:48:00 +01:00
Commit Graph

391 Commits

Author SHA1 Message Date
John Sterling
c1244805cf Add support for custom RSA key comments.
Add ivar and set/getComment() instead of constant. Also parse comment from applicable formats in loadKey().
2013-05-05 19:38:34 -04:00
Hans-Jürgen Petrich
dcac12003a Blowfish
Blowfish implementation
2013-05-05 09:32:00 +07:00
terrafrost
3ac29adff1 Merge remote-tracking branch 'petrich/master' into twofish 2013-05-03 01:43:43 -05:00
terrafrost
232d3e2725 Random: remove comment for old code 2013-05-01 08:13:41 -05:00
terrafrost
65a6c85450 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-05-01 00:33:13 -05:00
terrafrost
cb36b811a0 Random: use constant for windows test
BigInteger: Docblock adjustments
2013-05-01 00:30:01 -05:00
Hans-Jürgen Petrich
be47960908 Twofish
Twofish implementation
2013-04-30 17:26:14 +07:00
Hans-Jürgen Petrich
6b7c1da103 DES: removed debug code
removed debug code
2013-04-30 14:53:27 +07:00
Hans-Jürgen Petrich
c4752cbeba DES / 3DES Performance Update
DES / 3DES Performance Update.
Inline en/decrypting gives additional ~25% performance.
100% compatible with the current DES/TribleDES.php
Strong testet on Windows/Linux 32/64bit with php4/5.0/5.1//5.2/5.3/5.4
2013-04-25 14:16:10 +07:00
Patrick Monnerat
a13684584c DES: fix file permissions. 2013-04-24 11:02:01 +02:00
Patrick Monnerat
a8e5ccf895 DES: pre-permuted tables version. 2013-04-24 11:00:11 +02:00
terrafrost
f16d8ba6b2 Hash: docblock updates 2013-04-20 20:09:42 -05:00
terrafrost
700d28f642 RSA: apply terite's changes to RSA.php too 2013-04-08 01:04:52 -05:00
terrafrost
c5bd12dd14 RSA: Add CRYPT_RSA_PKCS15_COMPAT mode 2013-03-23 14:13:24 -05:00
terrafrost
11a6b1a1af RSA: only use OpenSSL if openssl.cnf file exists 2013-03-21 10:43:27 -05:00
terrafrost
35f5c83d36 Random: CS adjustment 2013-03-09 21:15:01 -06:00
Hans-Jürgen Petrich
ee84c4b41d $plaintext should be $ciphertext 2013-03-06 18:14:27 +07:00
terrafrost
994c2c6c79 Rijndael, TripleDES: $block not defined in these either 2013-03-05 00:19:11 -06:00
terrafrost
5f64ab67ab DES: $block wasn't defined 2013-03-04 08:25:40 -06:00
terrafrost
c4b3288851 TripleDES, Rijndael: Fix overflow in OFB mode 2013-03-03 17:30:30 -06:00
terrafrost
7ce05ed591 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-03-03 11:30:54 -06:00
terrafrost
15817a416e DES: Fix memory leak in OFB mode 2013-03-03 11:30:03 -06:00
Hans-Jürgen Petrich
eff0bb21c5 3DES/Rijndael/AES: Fix memory leak with CTR mode
Related to: https://github.com/phpseclib/phpseclib/issues/77
2013-03-03 17:26:41 +07:00
terrafrost
bf3ca6312e DES: Fix memory leak with CTR mode 2013-03-03 00:31:48 -06:00
terrafrost
eb860d275e RSA: Add support for AES-256-CBC 2013-02-27 20:00:20 -06:00
Hans-Jürgen Petrich
e90708297a Removed Debug function...
Removed Debug function...
2013-02-25 17:54:06 +07:00
Hans-Jürgen Petrich
afa5465e63 AES/Rijndael Performance Update [3]
Performance Update for AES/Rijndael
2013-02-25 12:19:51 +07:00
Patrick Monnerat
90ff746ad1 Make all sources 7-bit ASCII. 2013-02-20 19:25:47 +01:00
Gemorroj
cc2c844d0e some minor fixes 2013-02-20 16:46:13 +03:00
Hans-Jürgen Petrich
93f9922410 Small CS fix [2] 2013-02-07 00:45:03 +07:00
Hans-Jürgen Petrich
323396df3c Small CS fix 2013-02-03 23:19:09 +07:00
Hans-Jürgen Petrich
b4bbb27ef6 AES: Performance update
Performance update for AES
2013-01-31 00:59:53 +07:00
terrafrost
13eb688c90 AES, RC4: CS adjustments 2013-01-30 08:39:02 -06:00
terrafrost
248e3bb085 Undo last commit 2013-01-30 08:37:50 -06:00
terrafrost
bfb04dcf4d Add __construct() constructor to make namespace'ing easier for those wishing to do it 2013-01-29 22:09:31 -06:00
terrafrost
6765cb3b2b Rijndael, AES: CS adjustments 2013-01-27 01:21:28 -06:00
terrafrost
7894fd98f5 Merge pull request #65 from petrich/patch-3
Rijndael: Performance update
2013-01-26 16:29:26 -08:00
terrafrost
01be859b44 Merge pull request #66 from petrich/patch-5
AES: Performance update
2013-01-26 16:29:10 -08:00
terrafrost
d774476bcf RC4: keys were never being set in continuous mode 2013-01-26 11:16:42 -06:00
Hans-Jürgen Petrich
7dceef6ef4 AES: Performance update
Performance update for AES
Related to: https://github.com/phpseclib/phpseclib/pull/65
2013-01-26 16:58:31 +07:00
Hans-Jürgen Petrich
c95b997fa7 Rijndael: Performance update
Performance update for Rijndael
2013-01-26 16:54:19 +07:00
terrafrost
111544428e Merge pull request #63 from petrich/patch-3
Rijndael: little code optimizing
2013-01-25 21:52:40 -08:00
Hans-Jürgen Petrich
376b2759c9 RC4: fixed ContinuousBuffer() using MODE_MCRYPT
Fixed multiple calls to ContinuousBuffer() using MODE_MCRYPT
2013-01-21 21:01:37 +07:00
Hans-Jürgen Petrich
d81563d6f3 Rijndael: little code optimizing
little code optimizing
2013-01-21 15:46:44 +07:00
terrafrost
45976002c7 Merge pull request #61 from petrich/patch-3
AES: Fixed CFB decrypt() using MODE_MCRYPT and ContinuousBuffer
2013-01-20 22:57:43 -08:00
Hans-Jürgen Petrich
bfab4c47f9 DES: Fixed CFB decrypt() using MODE_MCRYPT and ContinuousBuffer
DES: Fixed small bug from commit d94f1b252d (DES.php in line 739-740)
in CFB decrypt() using CRYPT_DES_MODE_MCRYPT and enableContinuousBuffer()
2013-01-21 10:15:13 +07:00
Hans-Jürgen Petrich
2deea8b491 AES: Fixed CFB decrypt() using MODE_MCRYPT and ContinuousBuffer
AES: Fixed small bug from commit d94f1b252d (AES.php in line 425-426)
in CFB decrypt() using CRYPT_AES_MODE_MCRYPT and enableContinuousBuffer()
2013-01-21 10:08:49 +07:00
terrafrost
d94f1b252d AES, DES, RC4, Rijndael, TripleDES: multiple changes
- apply petrich's TripleDES / CFB decrypt to AES and DES
- make DES use the updated _generate_xor
- correct a comment typo
2013-01-20 10:11:19 -06:00
Hans-Jürgen Petrich
f7dc23a18e 3DES: Fixed ContinuousBuffer() in CTR/CFB/OFB
FIXED: multiple calls to enable/enableContinuousBuffer() work's now in CTR/CFB/OFB
FIXED: "Illegal string offset" and strlen(array()) Warning/Notice
Performance improvement in CFB Mode with enableContinuousBuffer() using MODE_MCRYPT
2013-01-14 21:23:20 +07:00
Hans-Jürgen Petrich
c624c785ee DES: Fixed CFB/OFB and continuousBuffer
FIXED: multiple calls to enable/disableCMode() will work now
FIXED: CFB/OFB modes
FIXED: "Illegal string offset" and strlen(array()) Warning/Notice
2013-01-13 01:48:48 +07:00
terrafrost
76a24dc546 AES: $pos will always be 0 in the last if statement for CFB 2013-01-11 18:09:28 -06:00
terrafrost
7c0926d94a Merge remote-tracking branch 'origin/petrich'
Conflicts:
	phpseclib/Crypt/AES.php
2013-01-11 18:06:43 -06:00
terrafrost
74e61deb4f AES: CFB: decrypted strings were being truncated 2013-01-11 15:30:06 -06:00
terrafrost
4a1cbfa7fd Merge remote-tracking branch 'petrich/patch-3' into petrich
Conflicts:
	phpseclib/Crypt/AES.php
2013-01-10 23:49:59 -06:00
terrafrost
bbd62f6490 AES: CFB mode fix 2013-01-10 20:42:38 -06:00
terrafrost
5ce9ad6a42 Random: $urandom -> $fp 2013-01-10 13:19:31 -06:00
Hans-Jürgen Petrich
20461866ef AES: Fix broken CFB and disableContinuousBuffer()
Related to: https://github.com/phpseclib/phpseclib/pull/45
2013-01-10 23:27:12 +07:00
terrafrost
d741def23c AES: Fix broken CFB and disableContinuousBuffer()
Quoting from petrich's pull request (from which this commit was inspired):

Fixed: Broken CFB in continuous mode when using CRYPT_AES_MODE_MCRYPT (related to: #39 )
Fixed: Multiple calls to enable/disableContinuousBuffer()
Fixed: Some PHP Notice/Warnings about strlen(array())
2013-01-09 17:39:57 -06:00
terrafrost
e71fc97913 Revamp SSH1 logging and go back to using user_error
(_handle_error returned the line number in _handle_error - not the line number triggering the error)
2013-01-08 22:09:27 -06:00
terrafrost
a890c6d127 Merge remote-tracking branch 'origin/petrich' 2013-01-06 19:14:05 -06:00
terrafrost
5e882d57fe Merge remote-tracking branch 'origin/petrich' 2013-01-06 19:10:25 -06:00
terrafrost
edc6d9cf5b AES.php in mcrypt mode always treated CFB as though it was a continuous cipher 2013-01-06 19:09:43 -06:00
terrafrost
fc2bf41588 Fix E_NOTICEs in the rewritten CFB mode 2013-01-06 19:08:36 -06:00
terrafrost
1626c0a3c7 CS adjustments to petrich's code and optimizations 2013-01-05 17:55:30 -06:00
terrafrost
fba455dfb2 Merge remote-tracking branch 'petrich/patch-2' into petrich
Conflicts:
	phpseclib/Crypt/Rijndael.php
2013-01-05 17:54:22 -06:00
Hans-Jürgen Petrich
d1f71cc5a7 Fixed CFB Decrypt(). Fixed OFB warnings
Fixed/rewritten: Decrypt() in CFB mode to work clean with enableContinuousBuffer()

Fixed: PHP's strlen(array()) warning in OFB mode,

Fixed: disableContinuousBuffer() clear's now also the $enbuffer/$debuffer arrays so that multiple calls to enable/disableContinuousBuffer() will work without old buffers
2013-01-05 16:23:35 +07:00
terrafrost
c1244dd339 CFB didn't always work in continuous mode 2013-01-04 20:53:23 -06:00
Hans-Jürgen Petrich
359e38b4d4 fixed corrupted decrypt() in CTR mode
$buffer['encrypted'] (which is always empty) should be $buffer['ciphertext'] or buffered stream will get corrupt...

Example:
define('CRYPT_AES_MODE',CRYPT_AES_MODE_INTERNAL);//in MODE_MCRYPT all is fine
$aes = new Crypt_AES(CRYPT_AES_MODE_CTR);
$aes->setKey(':-8');
$aes->enableContinuousBuffer();
$plaintext = ':-):-):-):-):-):-)';
for($i=0; $i<strlen($plaintext); $i++) {
 echo $aes->Decrypt($aes->Encrypt($plaintext[$i]));
}

Output:
:-):-):-):-):-):-(

Expected:
:-):-):-):-):-):-)


After Bugfix, output is:
:-):-):-):-):-):-)
2013-01-04 14:23:34 +07:00
terrafrost
61ad80fd64 More strlen() / empty() changes 2013-01-03 00:26:27 -06:00
terrafrost
9b4240c104 Use !empty('0') instead of strlen('0')
Thanks petrich!
2013-01-03 00:21:09 -06:00
terrafrost
e4ccaef7bf Make PEM lines be 64 bytes long instead of 72
Also, add more notes to Crypt_Random's comments
2012-12-18 07:11:24 -06:00
terrafrost
7f5e9f404a Random: expand on the explanations as to how things work 2012-12-17 08:41:47 -06:00
terrafrost
35832fe2a1 Refactor crypt_random (renaming it to crypt_random_string)
...and update all the calls to it accordingly
2012-12-16 02:20:16 -06:00
Patrick Monnerat
06779a92de Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts 2012-12-10 12:10:06 +01:00
Patrick Monnerat
f039a6ebc2 RSA: Allow changing openssl configuration file. X509: process HoldInstructionCode.
Also fixes HoldInstruction* OIDs.
2012-12-10 12:07:49 +01:00
terrafrost
3c6ae4312f The user_error in _handle_error shouldn't be replaced.. 2012-11-29 00:19:09 -06:00
terrafrost
3caaa91160 Replace user_error() with new _handle_error() function
To use exceptions do define('PHPSECLIB_USE_EXCEPTIONS', true).

To have the exceptions thrown by phpseclib be of a certain class define PHPSECLIB_EXCEPTION_CLASS.
2012-11-28 23:33:15 -06:00
terrafrost
fbf3ba353e Null pad RSA ciphertext's to be the length of the modulo and improve XML parsing 2012-11-19 23:00:04 -06:00
terrafrost
2a1909fd71 Set $this->paddable to true in a few missing places 2012-11-16 02:59:06 -06:00
Patrick Monnerat
26b842be5b X509: compute public key identifiers.
Force subject public key identifier when signing a CA.
2012-10-29 18:21:25 +01:00
terrafrost
7ba006ccdc Add getSize() function to Crypt_RSA 2012-10-07 18:53:26 -05:00
terrafrost
ee25c73a44 Three fixes
- Ingore white space in keys
- Handle negative numbers in the same way OpenSSL seems to handle them
- Fix signature verification (thanks Richard Odekerken!)
2012-09-29 14:32:27 -05:00
terrafrost
13eed6147a Do CRYPT_DES_MODE_CBC instead of CRYPT_MODE_DES_CBC 2012-09-22 11:38:09 -05:00
terrafrost
6686e203e7 Reformat keys even if private key format is the same OpenSSL uses
As is private keys weren't being encrypted when a private key was being set and OpenSSL was being used.

Thanks TeigneuX!
2012-09-18 05:17:14 -05:00
terrafrost
26776b486e Update a few comments 2012-09-03 01:42:50 -05:00
terrafrost
a3781bd172 Changing the public key format broke File_X509 2012-09-03 01:32:57 -05:00
terrafrost
2f8d1055ea Use OpenSSL for Math_BigInteger::modPow speedups
Also, make Crypt_RSA's public keys compatible with OpenSSL and make it so __toString will return the key even when it's the public key that's loaded and it hasn't been set as the public key.
2012-08-26 01:36:34 -05:00
terrafrost
6c4fcd34d3 Misc fixes
- make it so '' is a legit password and doesn't unset the pw to pass bantu's unit tests (unit test could have been updated too but whatever)
- make it so not passing in any parameters to Crypt_RSA::setPassword() works without E_NOTICE or E_WARNING as per example in docs
- add missing phpdoc headers to File_ANSI
- cryan -> cyan in File_ANSI
2012-08-23 08:59:49 -05:00
terrafrost
6e1b79ba24 - add __toString magic method to Crypt_RSA 2012-07-26 13:14:18 -05:00
terrafrost
f292931aed - make Net_SSH2 return more printer friendly server public host keys 2012-07-04 13:36:26 -05:00
terrafrost
1417463eba - make Crypt_RSA use openssl for key generation (if openssl is available) and make it so File_X509 can create CSRs 2012-07-01 12:07:42 -05:00
terrafrost
f0e1b2deec - add second function_exists call to prevent require_once from being called if autoloader was called 2012-06-27 20:56:36 -05:00
terrafrost
5eacf2b05d - do class_exists(Crypt_Random) too to facilitate auto-loading 2012-06-24 16:53:16 -05:00
terrafrost
6ee991f604 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2012-06-20 10:43:20 -05:00
terrafrost
1e3778dc4f - auto loading fixes (thanks skydiablo) 2012-06-20 10:36:36 -05:00
terrafrost
dfe264594f Merge pull request #9 from bantu/feature/consistent-file-endings
[feature/consistent-file-endings] Remove ?> and make sure there is an empty line at the end of files.
2012-06-16 21:06:15 -07:00
terrafrost
ccd2b6ae78 - PBKDF2 updates 2012-06-16 16:42:54 -05:00
Andreas Fischer
eb64dfef7d [feature/consistent-file-endings] Make sure files have empty line at the end. 2012-06-11 10:34:07 +02:00
Andreas Fischer
5923f4ad68 [feature/consistent-file-endings] Remove remaining ?> from PHP files. 2012-06-11 10:33:39 +02:00
Rob Loach
7e9a975296 Add Composer support to phpseclib 2012-06-08 15:38:27 -04:00
Andreas Fischer
71dea1fc2b [topic/40730] Use strlen() instead of count() in function _equals() of Crypt_RSA.
It appears that count() always returns int(1) on strings. Thus, this check is
pointless as is. strlen() was meant here and is actually required to prevent
E_NOTICEs from invalid array accesses using $y[$i].
2012-06-06 13:12:48 +02:00
Jim Wigginton
7f1c861c1a - $this->mcrypt was removed in a commit from yesterday
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@222 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-14 18:20:11 +00:00
Jim Wigginton
b39d2597dd - if the algorithm is not supported upon mcrypt's initial initialization use the internal implementation
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@220 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-14 01:21:21 +00:00
Jim Wigginton
5db0f88218 - add blinded rsa equality test (thanks singpolyma!)
- make validateSignature behave more like openssl_verify()

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@218 21d32557-59b3-4da0-833f-c5933fad653e
2012-05-05 23:57:30 +00:00
Jim Wigginton
6d60fa63e5 - make it so the following all do the same thing:
$pubKey = new Crypt_RSA();
$pubKey->loadKey($privKey->getPublicKey());
$pubKey->setPublicKey();

$pubKey = new Crypt_RSA();
$pubKey->loadKey($privKey->getPublicKey());
$pubKey->setPublicKey($privKey->getPublicKey());

$pubKey = new Crypt_RSA();
$pubKey->setPublicKey($privKey->getPublicKey());

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@211 21d32557-59b3-4da0-833f-c5933fad653e
2012-04-17 06:21:42 +00:00
Jim Wigginton
60340d5466 - make it so setPublicKey() can guess at the format like loadKey() can
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@204 21d32557-59b3-4da0-833f-c5933fad653e
2012-03-11 19:13:34 +00:00
Jim Wigginton
257b18501e - make setHash non case sensitive (thanks e1ven!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@191 21d32557-59b3-4da0-833f-c5933fad653e
2011-12-14 13:36:31 +00:00
Jim Wigginton
019edc6694 - the key has to be truncated before setKey() is called or else it'll be rounded up to the nearest key size - not down
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@190 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-25 00:11:19 +00:00
Jim Wigginton
f600a9bb50 - !== is faster than !=
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@189 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-24 19:03:56 +00:00
Jim Wigginton
70ea9ceec8 - update link to svn.php.net
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@188 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-24 18:46:12 +00:00
Jim Wigginton
e8d6d8d165 - use openssl_random_pseudo_bytes if available (thanks wise.man!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@187 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-24 18:32:49 +00:00
Jim Wigginton
b1c7fed946 - the IV wasn't resetting when mcrypt was being used
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@186 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-16 06:53:36 +00:00
Jim Wigginton
a00a5e6ba4 - add pbkdf2 support via setPassword()
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@185 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-13 02:23:56 +00:00
Jim Wigginton
bc1c12357d - CRYPT_RSA_PUBLIC_FORMAT_XML didn't work correctly
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@184 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-07 08:25:59 +00:00
Jim Wigginton
cfcf20cce5 - add the ability to save newly created keys in the XML and PuTTY formats
- add the ability to save private keys that have already been loaded

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@182 21d32557-59b3-4da0-833f-c5933fad653e
2011-11-07 01:35:12 +00:00
Jim Wigginton
d7c43d03a2 - fix bug with pure-PHP CTR mode (thanks, Max!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@177 21d32557-59b3-4da0-833f-c5933fad653e
2011-09-04 16:23:50 +00:00
Jim Wigginton
2676ca1d91 - password protected PuTTY keys error out ungracefully when a bad password is used to decrypt
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@176 21d32557-59b3-4da0-833f-c5933fad653e
2011-08-17 00:12:42 +00:00
Jim Wigginton
a5d702346a - improved handling of malformed RSA keys: part II
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@172 21d32557-59b3-4da0-833f-c5933fad653e
2011-07-11 00:37:46 +00:00
Jim Wigginton
d4a3d61ff5 - improved handling of malformed RSA keys (thanks scope_v24!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@171 21d32557-59b3-4da0-833f-c5933fad653e
2011-07-11 00:02:53 +00:00
Jim Wigginton
96471cf1dd - fix an E_NOTE error in Rijndael.php (thanks, tchamness!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@164 21d32557-59b3-4da0-833f-c5933fad653e
2011-06-04 16:10:05 +00:00
Jim Wigginton
737ea2c9e9 - add support for a new type of key format (thanks spotweb2!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@159 21d32557-59b3-4da0-833f-c5933fad653e
2011-05-28 16:23:15 +00:00
Jim Wigginton
c61b3f9da9 - fix E_NOTICE (thanks, loige!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@157 21d32557-59b3-4da0-833f-c5933fad653e
2011-05-08 03:09:11 +00:00
Jim Wigginton
392d96445e - add support for PuTTY and XML formatted RSA keys
- remove ?>'s from PHP_Compat files
- update LICENSE block
- make it so NET_SSH2_MSG_USERAUTH_PK_OK records direction and time

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@152 21d32557-59b3-4da0-833f-c5933fad653e
2011-04-18 12:17:40 +00:00
Jim Wigginton
06e8afb418 - fixed a bug that could prevent _emsa_pss_verify from working in rare circumstances (thanks Lesque!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@148 21d32557-59b3-4da0-833f-c5933fad653e
2011-03-19 03:32:22 +00:00
Jim Wigginton
27700e9ca7 - changed $fp to $urandom (thanks, Ben!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@144 21d32557-59b3-4da0-833f-c5933fad653e
2011-02-08 05:16:11 +00:00
Jim Wigginton
a4d39a9e66 - array_slice() reindexes the array so we'll use array_pop() instead
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@143 21d32557-59b3-4da0-833f-c5933fad653e
2011-02-06 16:35:48 +00:00
Jim Wigginton
5eea5be210 - fopen() can fail even when file_exists() succeeds (thanks, dakitiger!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@142 21d32557-59b3-4da0-833f-c5933fad653e
2011-02-06 01:12:20 +00:00
Jim Wigginton
80bf62d6fc - fix issues with partially generated RSA keys (thanks, Ben!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@141 21d32557-59b3-4da0-833f-c5933fad653e
2011-02-06 00:04:07 +00:00
Jim Wigginton
bf49338fa9 - the ciphertext wasn't being null padded correctly when it wasn't a multiple of the block size (thanks Elledan!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@139 21d32557-59b3-4da0-833f-c5933fad653e
2010-12-04 14:48:06 +00:00
Jim Wigginton
4ab5b5c16f - rm some legacy code and make Crypt_TripleDES better handle short keys
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@138 21d32557-59b3-4da0-833f-c5933fad653e
2010-12-02 04:59:46 +00:00
Jim Wigginton
354a0965e8 - AES should try to auto-predict the size of keys when the size isn't specified; last update interfered with that
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@137 21d32557-59b3-4da0-833f-c5933fad653e
2010-12-02 03:38:22 +00:00
Jim Wigginton
4d4cc0e0f5 - keys should now be null padded if they're too short
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@136 21d32557-59b3-4da0-833f-c5933fad653e
2010-12-01 05:09:01 +00:00
Jim Wigginton
66b5dad728 - rm debug code
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@133 21d32557-59b3-4da0-833f-c5933fad653e
2010-11-20 14:45:42 +00:00
Jim Wigginton
a31d9ba38d - rm debug code
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@131 21d32557-59b3-4da0-833f-c5933fad653e
2010-11-20 02:13:39 +00:00
Jim Wigginton
b94a467999 - change license to the less restrictive MIT license (if people want to modify phpseclib and distribute binaries of it [whatever that means for PHP] without including the source code I don't care); two of the three PHP_Compat stuff still uses the LGPL since I didn't author them but they're only needed, anyway, if you're using phpseclib on PHP4.
- add svn:eol-style: LF to all files
- fixed pear.php.net bug # 18037 (thanks, nounours!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@130 21d32557-59b3-4da0-833f-c5933fad653e
2010-11-13 19:28:20 +00:00
Jim Wigginton
dd4f0036f2 - fixed a bug that prevented key re-exchange from working
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@126 21d32557-59b3-4da0-833f-c5933fad653e
2010-10-24 01:24:30 +00:00
Jim Wigginton
a15cf62d3a - change $ecb to $this->ecb
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@124 21d32557-59b3-4da0-833f-c5933fad653e
2010-09-26 05:24:52 +00:00
Jim Wigginton
2140de74d0 - fixed a warning in Crypt_Rijndael
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@123 21d32557-59b3-4da0-833f-c5933fad653e
2010-09-26 05:02:10 +00:00
Jim Wigginton
76655b8bf9 - CFB mode is now supported as a stream cipher
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@122 21d32557-59b3-4da0-833f-c5933fad653e
2010-09-26 03:10:20 +00:00
Jim Wigginton
202c3b64e9 - added support for OFB and CFB modes (with the caveat that CFB mode isn't currently supported as a stream cipher)
- improvements to the fix to the bug Suby found
- fixed bug whereby CTR mode gave different results in mcrypt and internal modes when the continuous buffer was enabled and the plaintext being encrypted wasn't a multiple of the block size
- undid the fix for the bug f.dammassa found (thanks, j31!)


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@120 21d32557-59b3-4da0-833f-c5933fad653e
2010-09-12 21:58:54 +00:00
Jim Wigginton
b3690e0fde - added support for AES-128-CBC encrypted private keys (ie. the default format of OpenSSH 5.4+)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@119 21d32557-59b3-4da0-833f-c5933fad653e
2010-09-05 03:04:29 +00:00
Jim Wigginton
d07570b0eb - added limited support for keyboard-interactive authentication (thanks, j31!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@115 21d32557-59b3-4da0-833f-c5933fad653e
2010-08-28 17:26:22 +00:00
Jim Wigginton
d9d70f8797 - fixed a few bugs in Crypt_Hash
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@114 21d32557-59b3-4da0-833f-c5933fad653e
2010-08-08 21:29:39 +00:00
Jim Wigginton
f088d89712 - add logging to Net_SSH1 and fixed a bug in Crypt_DES (thanks, Suby!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@113 21d32557-59b3-4da0-833f-c5933fad653e
2010-08-08 05:06:38 +00:00
Jim Wigginton
3ef15724be - undo last commit - if you want to load a public key use loadKey(). it's called loadKey() and not loadPublicKey() for a reason. and while you're at it reread the documentation. i do have to concede, though... i should have read my own documentation before making the last commit.
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@112 21d32557-59b3-4da0-833f-c5933fad653e
2010-07-11 02:33:13 +00:00
Jim Wigginton
dff1ab92d6 - fixed bug in setPublicKey function (thanks nicklong!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@110 21d32557-59b3-4da0-833f-c5933fad653e
2010-06-19 12:01:21 +00:00
Jim Wigginton
6057a9da8f - fixed a bug in Crypt_Random
- SSH2 logging now more closely resembles the format of PuTTY logs


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@105 21d32557-59b3-4da0-833f-c5933fad653e
2010-04-24 06:40:49 +00:00
Jim Wigginton
fa9e1f4f50 - suppress possible openbase_dir errors
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@103 21d32557-59b3-4da0-833f-c5933fad653e
2010-04-13 12:41:14 +00:00
Jim Wigginton
7fd48f8e72 - compatability adjustments for interoperability with strictly PKCS#1 v1.5 compliant RSA implementations
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@102 21d32557-59b3-4da0-833f-c5933fad653e
2010-04-10 15:57:02 +00:00
Jim Wigginton
39c97d3373 - crypt_random() used /dev/urandom in a rather slow way (thanks, TangiX!)
- revamped the logging system.  now, you can profile SSH2.php / SFTP.php without capturing full logs


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@99 21d32557-59b3-4da0-833f-c5933fad653e
2010-04-07 03:50:54 +00:00
Jim Wigginton
1539cd4a01 - the triple equals in Math_BigIinteger::equals() made it so float(1) != int(1), so all instances where float(1) might occur have been removed
- Crypt_RSA::_blind() should now be faster.


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@95 21d32557-59b3-4da0-833f-c5933fad653e
2010-03-01 17:28:19 +00:00
Jim Wigginton
c0b0886762 - use crypt_random for RSA blinding
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@94 21d32557-59b3-4da0-833f-c5933fad653e
2010-02-28 06:57:00 +00:00
Jim Wigginton
695207246a - fixed a bug that prevented multi-prime RSA keys from loading
- slightly refactored Random.php
- implemented RSA blinding


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@93 21d32557-59b3-4da0-833f-c5933fad653e
2010-02-28 05:28:38 +00:00
Jim Wigginton
748983a824 - speed up BigInteger.php
- added support for more public / private key formats (thanks, m4rc!)


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@91 21d32557-59b3-4da0-833f-c5933fad653e
2010-02-26 03:40:26 +00:00
Jim Wigginton
f2ccfdb0ac - improved random number generator
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@89 21d32557-59b3-4da0-833f-c5933fad653e
2010-02-19 22:39:44 +00:00
Jim Wigginton
d77c85218d - removed setMCrypt from the Crypt_* objects (you can achieve the same effect by doing ini_set('mcrypt.algorithms_dir', $path))
- added support for CTR mode to the various Crypt_* objects


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@83 21d32557-59b3-4da0-833f-c5933fad653e
2010-02-09 06:10:26 +00:00
Jim Wigginton
f96700960a - fixed an E_NOTICE error (thanks bietchetlien!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@81 21d32557-59b3-4da0-833f-c5933fad653e
2010-01-29 06:21:16 +00:00
Jim Wigginton
1e8a295994 - defined $this->mgfHLen
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@79 21d32557-59b3-4da0-833f-c5933fad653e
2010-01-25 07:42:45 +00:00
Jim Wigginton
1841949aaf - removed debug code
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@78 21d32557-59b3-4da0-833f-c5933fad653e
2010-01-23 17:36:49 +00:00
Jim Wigginton
a8f0567527 - sped up Math_BigInteger
- fixed a bug whereby partial RSA keys didn't function properly (thanks, CountZero!)
- fixed a bug that prevented setPrecision from working correctly with non multiples of eight
- fixed a few E_NOTICEs


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@76 21d32557-59b3-4da0-833f-c5933fad653e
2010-01-21 00:52:11 +00:00
Jim Wigginton
7ecd481002 - fixes to Math_BigInteger::_barrett()
- speed ups based on <http://blog.libssh2.org/index.php?/archives/21-Compiled-Variables.html>.


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@74 21d32557-59b3-4da0-833f-c5933fad653e
2010-01-04 07:59:01 +00:00
Jim Wigginton
e16ba96789 - fixed a few E_NOTICE errors
- sped up Math_BigInteger::_barrett()


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@73 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-31 06:11:07 +00:00
Jim Wigginton
8379f46a77 _mgf1() shouldn't be using $this->hLen
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@69 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-08 14:18:59 +00:00
Jim Wigginton
315dec9dc5 - loadKey returns false on failure and true on success (thanks, seriksen!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@68 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-07 23:22:05 +00:00
Jim Wigginton
9bd3c793d3 - an inability to unpad doesn't necessarily mean that padding is enabled when it shouldn't be - it might also mean that the key being used is the wrong one.
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@67 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-06 07:26:52 +00:00
Jim Wigginton
793a355862 typo
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@66 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-04 21:05:32 +00:00
Jim Wigginton
a7a41ff610 $this->publicKey -> $this->publicExponent
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@65 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-04 20:50:21 +00:00
Jim Wigginton
a882a3a41f - added Crypt_RSA
- added RSA public key authentication to Net_SSH2


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@62 21d32557-59b3-4da0-833f-c5933fad653e
2009-12-03 08:19:00 +00:00
Jim Wigginton
239f48cc6c - added a missing break
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@58 21d32557-59b3-4da0-833f-c5933fad653e
2009-11-23 23:37:07 +00:00
Jim Wigginton
4fd4601ed8 - rm bin2hex() call in _md2()
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@57 21d32557-59b3-4da0-833f-c5933fad653e
2009-11-23 22:03:08 +00:00
Jim Wigginton
a4e72f7811 - replaced list(...) = unpack('...') calls with extract(unpack('...')) (thanks martinu!)
- added pure-php implementations of md2, sha256, and sha512 to Crypt_Hash
- added setPrecision() to Math_BigInteger
- other small fixes


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@56 21d32557-59b3-4da0-833f-c5933fad653e
2009-11-23 19:06:07 +00:00
Jim Wigginton
f50e880c41 - accommodate new Math_BigInteger updates
- fix a typo in Crypt_Rijndael's comments


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@54 21d32557-59b3-4da0-833f-c5933fad653e
2009-11-03 22:03:43 +00:00
Jim Wigginton
65119f79d7 - small cosmetic issues
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@49 21d32557-59b3-4da0-833f-c5933fad653e
2009-10-07 20:53:19 +00:00
Jim Wigginton
a90471b937 - fixed a few bad constants (thanks, YeongGwon Jeong!)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@41 21d32557-59b3-4da0-833f-c5933fad653e
2009-08-09 03:53:28 +00:00
Jim Wigginton
d6339e014f - Net_SFTP now has better support for uploading large files than it did before, per this:
http://www.frostjedi.com/phpbb/viewtopic.php?f=46&t=10415


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@40 21d32557-59b3-4da0-833f-c5933fad653e
2009-06-09 04:00:38 +00:00
Jim Wigginton
ed39f723c9 - xor swap doesn't work when you're swapping elements with themselves
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@35 21d32557-59b3-4da0-833f-c5933fad653e
2009-05-27 21:36:53 +00:00
Jim Wigginton
c17f22ead9 - Crypt_Rijndael has issues when setKey() isn't called, as well
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@34 21d32557-59b3-4da0-833f-c5933fad653e
2009-05-27 16:25:35 +00:00
Jim Wigginton
9194759d58 - cosmetic changes to the code
- encryption should work even when setKey() isn't called
- padding wasn't always done when it should have been


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@33 21d32557-59b3-4da0-833f-c5933fad653e
2009-05-27 16:15:23 +00:00
Jim Wigginton
3d88765f1d - removed debug code
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@30 21d32557-59b3-4da0-833f-c5933fad653e
2009-04-28 02:56:34 +00:00
Jim Wigginton
1eb6ac05c0 $x & 3 == 1 is the same thing as $x & (3 == 1) per php's order of precidence
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@24 21d32557-59b3-4da0-833f-c5933fad653e
2009-03-09 05:13:24 +00:00
Jim Wigginton
736bfab276 - fix E_NOTICE notices
- renamed hmac() -> hash() in SSH2.php


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@23 21d32557-59b3-4da0-833f-c5933fad653e
2009-02-26 17:25:03 +00:00
Jim Wigginton
a8e70cbaa5 - forgot to add AES
- added __toString() to BigInteger.php (thanks, Techie-Michael!)


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@22 21d32557-59b3-4da0-833f-c5933fad653e
2009-02-16 23:11:01 +00:00
Jim Wigginton
39de68ab48 - [bug] Crypt_Rijndael calculated IVs incorrectly
- [new] renamed Crypt_HMAC to Crypt_Hash and revised the API
- [new] added Crypt_AES
- [new] added AES support to Net_SSH2


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@21 21d32557-59b3-4da0-833f-c5933fad653e
2009-02-16 22:22:13 +00:00
Jim Wigginton
c30f3b7e9a - pure-PHP implementation of Rijndael
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@20 21d32557-59b3-4da0-833f-c5933fad653e
2009-02-01 15:37:25 +00:00
Jim Wigginton
a78d7df660 - if padding is disabled and the length of the text-to-be-encrypted isn't a multiple of the block size, padding will be automatically enabled
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@19 21d32557-59b3-4da0-833f-c5933fad653e
2008-08-04 17:59:12 +00:00
Jim Wigginton
943f329197 - pack should be unpack
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@16 21d32557-59b3-4da0-833f-c5933fad653e
2008-05-21 05:15:32 +00:00
Jim Wigginton
6101b23a32 - fixed a bug discovered by MarkDHamill (see http://www.frostjedi.com/phpbb/viewtopic.php?f=46&t=9796)
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@11 21d32557-59b3-4da0-833f-c5933fad653e
2008-03-31 00:49:09 +00:00
Jim Wigginton
890ae4db4a - added sha1-96 and md5-96
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@9 21d32557-59b3-4da0-833f-c5933fad653e
2007-09-23 04:41:39 +00:00
Jim Wigginton
29ee82e67b - updated URL
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@7 21d32557-59b3-4da0-833f-c5933fad653e
2007-07-25 21:56:14 +00:00
Jim Wigginton
df0fe2386a - added SSH2.php and HMAC.php
- fixed issue with the IV's in TripleDES.php and DES.php
- fixed decryption in TripleDES.php using CRYPT_DES_MODE_INTERNAL
- renamed CRYPT_DES_MODE_SSH to CRYPT_DES_MODE_3CBC
- added CRYPT_DES_MODE_CBC3 as an alias for CRYPT_DES_MODE_CBC
- fixed issue with RC4.php using CRYPT_RC4_MODE_MCRYPT


git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@4 21d32557-59b3-4da0-833f-c5933fad653e
2007-07-23 05:21:39 +00:00
Jim Wigginton
367ddebf80 - initial commit
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@3 21d32557-59b3-4da0-833f-c5933fad653e
2007-07-02 04:19:55 +00:00