diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2023-01-06 20:48:22 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2023-01-06 20:48:22 +0000 |
| commit | 6f4e10db3298f6d65e1e646fe52aaafc3682b788 (patch) | |
| tree | 0a8de0ec1173c00886bcde1c3b18e0963e5f2b83 /doc/doxyout/hcrypto/html/page_des.html | |
| parent | d5d1e8b157da7410fe13e6302f8e1bee81320bb5 (diff) | |
Diffstat (limited to 'doc/doxyout/hcrypto/html/page_des.html')
| -rw-r--r-- | doc/doxyout/hcrypto/html/page_des.html | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/doc/doxyout/hcrypto/html/page_des.html b/doc/doxyout/hcrypto/html/page_des.html index deca0af6ecd6..d7a6f7a200c1 100644 --- a/doc/doxyout/hcrypto/html/page_des.html +++ b/doc/doxyout/hcrypto/html/page_des.html @@ -8,21 +8,22 @@ <a href="http://www.h5l.org/"><img src="http://www.h5l.org/keyhole-heimdal.png" alt="keyhole logo"/></a> </p> <!-- end of header marker --> -<!-- Generated by Doxygen 1.8.13 --> +<!-- Generated by Doxygen 1.9.1 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> +/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); -</script> +/* @license-end */</script> <div id="main-nav"></div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="index.html">Heimdal crypto library</a></li> </ul> </div> </div><!-- top --> -<div class="header"> +<div class="PageDoc"><div class="header"> <div class="headertitle"> <div class="title">DES - Data Encryption Standard crypto interface </div> </div> </div><!--header--> @@ -35,14 +36,23 @@ $(function() { DES key generation</h1> <p>To generate a DES key safely you have to use the code-snippet below. This is because the <a class="el" href="group__hcrypto__des.html#gad70d485549f7444589f3283e938c0258">DES_random_key()</a> can fail with an abort() in case of and failure to start the random generator.</p> <p>There is a replacement function <a class="el" href="group__hcrypto__des.html#gacd3642bcd8a7e93ea977786e5b540d5f">DES_new_random_key()</a>, however that function does not exists in OpenSSL.</p> -<div class="fragment"><div class="line">DES_cblock key;</div><div class="line"><span class="keywordflow">do</span> {</div><div class="line"> <span class="keywordflow">if</span> (RAND_rand(&key, <span class="keyword">sizeof</span>(key)) != 1)</div><div class="line"> <span class="keywordflow">goto</span> failure;</div><div class="line"> <a class="code" href="group__hcrypto__des.html#ga4179bef43ceb72cc2034f39e7d2d5ae4">DES_set_odd_parity</a>(key);</div><div class="line">} <span class="keywordflow">while</span> (<a class="code" href="group__hcrypto__des.html#ga0d8a49cafee4be6cd3922bfb6323fd2d">DES_is_weak_key</a>(&key));</div></div><!-- fragment --><h1><a class="anchor" id="des_impl"></a> +<div class="fragment"><div class="line">DES_cblock key;</div> +<div class="line"><span class="keywordflow">do</span> {</div> +<div class="line"> <span class="keywordflow">if</span> (RAND_rand(&key, <span class="keyword">sizeof</span>(key)) != 1)</div> +<div class="line"> <span class="keywordflow">goto</span> failure;</div> +<div class="line"> <a class="code" href="group__hcrypto__des.html#ga4179bef43ceb72cc2034f39e7d2d5ae4">DES_set_odd_parity</a>(key);</div> +<div class="line">} <span class="keywordflow">while</span> (<a class="code" href="group__hcrypto__des.html#ga0d8a49cafee4be6cd3922bfb6323fd2d">DES_is_weak_key</a>(&key));</div> +<div class="ttc" id="agroup__hcrypto__des_html_ga0d8a49cafee4be6cd3922bfb6323fd2d"><div class="ttname"><a href="group__hcrypto__des.html#ga0d8a49cafee4be6cd3922bfb6323fd2d">DES_is_weak_key</a></div><div class="ttdeci">int DES_is_weak_key(DES_cblock *key)</div><div class="ttdef"><b>Definition:</b> des.c:178</div></div> +<div class="ttc" id="agroup__hcrypto__des_html_ga4179bef43ceb72cc2034f39e7d2d5ae4"><div class="ttname"><a href="group__hcrypto__des.html#ga4179bef43ceb72cc2034f39e7d2d5ae4">DES_set_odd_parity</a></div><div class="ttdeci">void DES_set_odd_parity(DES_cblock *key)</div><div class="ttdef"><b>Definition:</b> des.c:117</div></div> +</div><!-- fragment --><h1><a class="anchor" id="des_impl"></a> DES implementation history</h1> <p>There was no complete BSD licensed, fast, GPL compatible implementation of DES, so Love wrote the part that was missing, fast key schedule setup and adapted the interface to the orignal libdes.</p> <p>The document that got me started for real was "Efficient Implementation of the Data Encryption Standard" by Dag Arne Osvik. I never got to the PC1 transformation was working, instead I used table-lookup was used for all key schedule setup. The document was very useful since it de-mystified other implementations for me.</p> <p>The core DES function (SBOX + P transformation) is from Richard Outerbridge public domain DES implementation. My sanity is saved thanks to his work. Thank you Richard. </p> </div></div><!-- contents --> +</div><!-- PageDoc --> <hr size="1"><address style="text-align: right;"><small> -Generated on Fri Jun 7 2019 02:49:57 for Heimdal crypto library by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.8.13</small></address> +Generated on Tue Nov 15 2022 14:04:26 for Heimdal crypto library by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.9.1</small></address> </body> </html> |
