Skip to content

Commit

Permalink
HTML validation error fix for rest of the files
Browse files Browse the repository at this point in the history
This fixes the validation errors reported by https://validator.w3.org. For crypt/examples.html this was already done on the PR #6. This is for the rest of the HTML files.
  • Loading branch information
Joey3000 committed Jan 23, 2016
1 parent ae14c8e commit 880df78
Show file tree
Hide file tree
Showing 23 changed files with 93 additions and 98 deletions.
3 changes: 3 additions & 0 deletions 2.0.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,8 @@ <h2 id="rsassh">Log into SSH server with RSA key</h2>
echo $ssh->exec('ls -la');
</pre>
</div>
<!-- end .grid_8 -->
</div>
<!-- end .container_12 -->
</body>
</html>
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ <h1>php<span class="red">sec</span>lib 1.0: An Introduction</h1>
</div>
<div class="grid_4">
<h2>Pure-PHP implementations of:</h2>
<p>
<ul>
<li><a href="math/intro.html">BigIntegers</a></li>
<li><a href="rsa/intro.html">RSA</a></li>
Expand All @@ -77,7 +76,6 @@ <h2>Pure-PHP implementations of:</h2>
</ul></div>
</li>
</ul>
</p>
<p>
<a href="http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.1.zip/download" class="button">Download phpseclib 1.0.1</a>
</p>
Expand Down Expand Up @@ -117,8 +115,11 @@ <h2>Other Branches: 2.0 and master</h2>
<script type="text/javascript" src="http://www.ohloh.net/p/110463/widgets/project_thin_badge.js"></script>
</p>
<p style="float: left; width: 25%; text-align: right">
<a href="http://sourceforge.net/donate/index.php?group_id=198487"><img src="http://images.sourceforge.net/images/project-support.jpg" width="88" height="32" border="0" alt="Support This Project" /></a>
<a href="http://sourceforge.net/donate/index.php?group_id=198487"><img src="http://images.sourceforge.net/images/project-support.jpg" width="88" height="32" alt="Support This Project" /></a>
</p>
</div>
<!-- end .grid_24 -->
</div>
<!-- end .container_12 -->
</body>
</html>
32 changes: 2 additions & 30 deletions interop.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ <h1>php<span class="red">sec</span>lib: OpenSSL Interoperability</h1>


<div id="rsaencpkcs1">
<p>
<h2>Encrypt (PKCS#1) with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
Expand All @@ -153,8 +152,6 @@ <h3><a href="#" class="p1phpseclib">phpseclib</a></h3>
echo $rsa->encrypt(file_get_contents('plaintext.txt'));</pre>
</div>
</div>
</p>
<p>
<h2>Decrypt with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand All @@ -172,15 +169,13 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
<code>openssl rsautl -inkey privatekey.txt -decrypt -in ciphertext.txt -out plaintext.txt</code>
</div>
</div>
</p>
</div>





<div id="rsaoaep">
<p>
<h2>Encrypt (OAEP) with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
Expand All @@ -198,8 +193,6 @@ <h3><a href="#" class="p1phpseclib">phpseclib</a></h3>
echo $rsa->encrypt(file_get_contents('plaintext.txt'));</pre>
</div>
</div>
</p>
<p>
<h2>Decrypt with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand All @@ -217,7 +210,6 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
<code>openssl rsautl -inkey privatekey.txt -decrypt -oaep -in ciphertext.txt -out plaintext.txt</code>
</div>
</div>
</p>
</div>


Expand All @@ -226,7 +218,6 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>


<div id="rsasigpkcs1">
<p>
<h2>Sign (PKCS#1) with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
Expand All @@ -247,8 +238,6 @@ <h3><a href="#" class="p1phpseclib">phpseclib</a></h3>
);</pre>
</div>
</div>
</p>
<p>
<h2>Verify with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand All @@ -270,7 +259,6 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
<code>openssl dgst -sha1 -verify publickey.txt -signature signature.txt plaintext.txt</code>
</div>
</div>
</p>
</div>


Expand All @@ -281,7 +269,6 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>


<div id="rsapss">
<p>
<h2>Sign (PSS) with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
Expand All @@ -301,8 +288,6 @@ <h3><a href="#" class="p1phpseclib">phpseclib</a></h3>
);</pre>
</div>
</div>
</p>
<p>
<h2>Verify with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand All @@ -323,24 +308,20 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
<code>openssl dgst -sha1 -sigopt rsa_padding_mode:pss -sigopt rsa_pss_saltlen:-1 -verify publickey.txt -signature signature.txt plaintext.txt</code>
</div>
</div>
</p>
</div>





<div id="aes">
<p>
<h2>Encrypt with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
<div>
<code>openssl enc -aes-128-cbc -e -in plaintext.txt -out ciphertext.txt -nosalt -K AA -iv AA -p</code>
</div>
</div>
</p>
<p>
<h2>Decrypt with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand All @@ -354,7 +335,6 @@ <h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
echo $aes->decrypt(file_get_contents('ciphertext.txt'));</pre>
</div>
</div>
</p>
</div>


Expand All @@ -364,7 +344,6 @@ <h3><a href="#" class="p2phpseclib">phpseclib</a></h3>


<div id="seal">
<p>
<h2>"Seal" with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
Expand Down Expand Up @@ -418,8 +397,6 @@ <h3><a href="#" class="p1phpseclib">phpseclib</a></h3>


</div>
</p>
<p>
<h2>"Open" with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand Down Expand Up @@ -451,15 +428,13 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
?></pre>
</div>
</div>
</p>
</div>





<div id="privateenc">
<p>
<h2>Encrypt with</h2>
<div class="accordion" style="margin: 0; padding: 0">
<h3><a href="#" class="p1openssl">OpenSSL</a></h3>
Expand Down Expand Up @@ -497,8 +472,6 @@ <h3><a href="#" class="p1phpseclib">phpseclib</a></h3>


</div>
</p>
<p>
<h2>Decrypt with</h2>
<div class="accordion">
<h3><a href="#" class="p2phpseclib">phpseclib</a></h3>
Expand Down Expand Up @@ -531,7 +504,6 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
?></pre>
</div>
</div>
</p>
</div>


Expand All @@ -541,10 +513,10 @@ <h3><a href="#" class="p2openssl">OpenSSL</a></h3>
<div id="permlink"><span>permanent link</span></div>



</div>
</div>
<!-- end .grid_9 -->
</div>
<!-- end .container_16 -->
<!-- end .container_12 -->
</body>
</html>
10 changes: 6 additions & 4 deletions math/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,12 @@ <h2>Notes</h2>
Absolute Value
</div>
<div class="compare">
<p><code>$a->compare($b)</code> returns 1 if <code>$a > $b</code>, 0 if <code>$a == $b</code>, and -1 if <code>$a < $b</code>. The reason for this is demonstrated thusly:</p>
<p><code>$a->compare($b)</code> returns 1 if <code>$a > $b</code>, 0 if <code>$a == $b</code>, and -1 if <code>$a &lt; $b</code>. The reason for this is demonstrated thusly:</p>
<pre style="background: #ffa">$x > $y: $x->compare($y) > 0
$x < $y: $x->compare($y) < 0
$x &lt; $y: $x->compare($y) &lt; 0
$x == $y: $x->compare($y) == 0
$x >= $y: $x->compare($y) >= 0
$x <= $y: $x->compare($y) <= 0</pre>
$x &lt;= $y: $x->compare($y) &lt;= 0</pre>
<p>As a consequence of this, <code>!$x->compare($y)</code> does not mean <code>$x != $y</code> but rather <code>$x == $y</code>. If you want to test for equality, use <code>$x->equals($y)</code>.</p>
</div>
<div class="equals">
Expand Down Expand Up @@ -311,8 +311,10 @@ <h2>Notes</h2>
<div class="tobits tobytes tohex">
If the optional parameter is set to bool(true) the number will be encoded in <a href="http://en.wikipedia.org/wiki/Two%27s_complement">two's complement</a>.
</div>
</div>
</div>
<!-- end .grid_9 -->
</div>
<!-- end .container_16 -->
<!-- end .container_12 -->
</body>
</html>
9 changes: 4 additions & 5 deletions math/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ <h2>Operations</h2>
<li><a href="examples.html#randomprime">randomPrime()</a></li>
<li><a href="examples.html#isprime">isPrime()</a></li>
</ul>
<p>
<h2>Bitwise Operations</h2>
<ul>
<li><a href="examples.html#setprecision">setPrecision()</a></li>
Expand All @@ -92,8 +91,6 @@ <h2>Bitwise Operations</h2>
<li><a href="examples.html#bitwiserightshift">bitwise_rightShift()</a></li>
<li><a href="examples.html#bitwiserightrotate">bitwise_rightRotate()</a></li>
</ul>
</p>
<p>
<h2>Formating</h2>
<ul>
<li><a href="examples.html#constructor">Constructor</a></li>
Expand All @@ -102,13 +99,12 @@ <h2>Formating</h2>
<li><a href="examples.html#tobytes">toBytes()</a></li>
<li><a href="examples.html#tobits">toBits()</a></li>
</ul>
</p>
</div>
<div class="grid_8">
<h2>Speed Analysis</h2>
<p>The following <a href="http://en.wikipedia.org/wiki/Heat_map">heat map</a> shows how many <b>seconds</b> Math_BigInteger takes to perform encryption / decryption with a 2048-bit RSA key on an Intel Core i5-3320M CPU @ 2.6GHz under various environments. <a href="benchmark.phps">benchmark.phps</a> was used to generate the heatmap. col*.php are all variations of <a href="speed.phps">speed.phps</a>.</p>
<p>Math_BigInteger automatically picks the fastest settings to use depending on what extensions it has available at its disposal.</p>
<table border="1">
<table>
<thead>
<tr><td style="border: 0; background: white"></td><td>Internal</td><td>BCMath</td><td>Internal</td><td>BCMath</td><td>GMP</td></tr>
<tr><td style="border: 0; background: white"></td><td colspan="2" style="background: wheat; font-weight: normal; text-align: center">w/o OpenSSL</td><td colspan="2" style="background: wheat; font-weight: normal; text-align: center">w/ OpenSSL</td><td style="border: 0; background: white"></td></tr>
Expand All @@ -130,5 +126,8 @@ <h2>GMP Engine</h2>
<h2>OpenSSL Enhancements</h2>
<p>Only used for powMod(). Converts the exponent and the modulo to an appropriately formatted RSA public key and performs non-padded RSA encryption with that.</p>
</div>
<!-- end .grid_8 -->
</div>
<!-- end .container_12 -->
</body>
</html>
2 changes: 1 addition & 1 deletion rsa/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ <h1>php<span class="red">sec</span>lib: RSA Examples and Notes</h1>
$ciphertext = $rsa->encrypt($plaintext);

$rsa->loadKey('...'); // private key
echo $rsa->decrypt($ciphertext);</span></span>
echo $rsa->decrypt($ciphertext);</span>
?&gt;</pre>
</div>
<div id="permlink"><span>permanent link</span></div>
Expand Down
5 changes: 3 additions & 2 deletions rsa/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ <h2>Supported Private Key Formats</h2>
<li><a href="examples.html#convert,encputty">PuTTY</a> (with password)</li>
<li><a href="examples.html#convert,xml">XML Signature</a> (<a href="http://en.wikipedia.org/wiki/XML_Signature">more info</a>)</li>
</ul>
<p>
<h2>Supported Public Key Formats</h2>
<ul>
<li><a href="examples.html#public">PKCS#1</a></li>
<li><a href="examples.html#public,openssh">OpenSSH</a></li>
<li><a href="examples.html#public,xmlpub">XML Signature</a></li>
</ul>
</p>
</div>
<div class="grid_8">
<h2>Features</h2>
Expand All @@ -95,5 +93,8 @@ <h2>Features</h2>
<li>Utilizes <a href="http://en.wikipedia.org/wiki/Blinding_%28cryptography%29">RSA Blinding</a></li>
</ul>
</div>
<!-- end .grid_8 -->
</div>
<!-- end .container_12 -->
</body>
</html>
3 changes: 2 additions & 1 deletion sftp/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ <h2>Downloading files</h2>
<p>Returns a string containing the contents of $remote_file if $local_file is left undefined or a boolean false if the operation was unsuccessful. If $local_file is defined, returns true or false depending on the success of the operation.</p>
</div>
</div>
</div>
<!-- end .grid_9 -->
</div>
<!-- end .container_16 -->
<!-- end .container_12 -->
</body>
</html>
3 changes: 3 additions & 0 deletions sftp/intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@ <h2>Features</h2>
</li>
</ul>
</div>
<!-- end .grid_8 -->
</div>
<!-- end .container_12 -->
</body>
</html>
3 changes: 2 additions & 1 deletion ssh/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ <h2>Better Example Wanted</h2>
<p>I would provide a better example but have never had direct access to an SSH server that did authentication in this manner nor do I know how to set one up.</p>
</div>
</div>
</div>
<!-- end .grid_9 -->
</div>
<!-- end .container_16 -->
<!-- end .container_12 -->
</body>
</html>
7 changes: 5 additions & 2 deletions ssh/compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ <h2 id="pubkey">Public Key Support</h2>

echo $ssh->exec('ls -la');</pre>
<p>Ignoring the API for the time being there are a few clear ways phpseclib comes out on top here:</p>
<p><ul>
<ul>
<li>phpseclib takes in strings - not file paths. If you want to do a file you can do file_get_contents.</li>
<li>phpseclib doesn't require a public key. Most private key formats have the public key embedded within them. And if they don't... phpseclib supports that too.</li>
<li>phpseclib can take in pretty much any standardized format, from PKCS#1 formatted keys, to PuTTY keys, to XML Signature keys</li>
</ul></p>
</ul>
<h2 id="diagnosis">Diagnosing Problems</h2>
<p>Why didn't top or sudo work? With phpseclib you can <a href="examples.html#oneoff,logging">get logs</a>. They look like this:</p>
<p><a href="http://phpseclib.sourceforge.net/ssh/log.txt">http://phpseclib.sourceforge.net/ssh/log.txt</a></p>
Expand All @@ -182,5 +182,8 @@ <h2 id="interactive">Interactive Shell</h2>
echo fread($shell, 1024*1024);</pre>
<p>It is additionally unclear how to get top working with libssh2 but it works perfectly fine with phpseclib: <a href="examples.html#top">examples.html#top</a>.</p>
</div>
<!-- end .grid_8 -->
</div>
<!-- end .container_12 -->
</body>
</html>
Loading

0 comments on commit 880df78

Please sign in to comment.