diff options
author | jmc <> | 2016-11-10 14:34:18 +0000 |
---|---|---|
committer | jmc <> | 2016-11-10 14:34:18 +0000 |
commit | f09d61b594eba5f8f4ebf834ec2f18203636bcf5 (patch) | |
tree | 8e5a7bb432fb01e6ee508c5a7327eb41f4a0c92a /src/lib/libcrypto/man/DES_set_key.3 | |
parent | e19a4e15d73261c4eaf9f544789343e0ae570455 (diff) | |
download | openbsd-f09d61b594eba5f8f4ebf834ec2f18203636bcf5.tar.gz openbsd-f09d61b594eba5f8f4ebf834ec2f18203636bcf5.tar.bz2 openbsd-f09d61b594eba5f8f4ebf834ec2f18203636bcf5.zip |
various cleanup;
Diffstat (limited to 'src/lib/libcrypto/man/DES_set_key.3')
-rw-r--r-- | src/lib/libcrypto/man/DES_set_key.3 | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/lib/libcrypto/man/DES_set_key.3 b/src/lib/libcrypto/man/DES_set_key.3 index 1e4de6255f..804754e2ce 100644 --- a/src/lib/libcrypto/man/DES_set_key.3 +++ b/src/lib/libcrypto/man/DES_set_key.3 | |||
@@ -1,6 +1,6 @@ | |||
1 | .\" $OpenBSD: DES_set_key.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: DES_set_key.3,v 1.3 2016/11/10 14:34:18 jmc Exp $ |
2 | .\" | 2 | .\" |
3 | .Dd $Mdocdate: November 6 2016 $ | 3 | .Dd $Mdocdate: November 10 2016 $ |
4 | .Dt DES_SET_KEY 3 | 4 | .Dt DES_SET_KEY 3 |
5 | .Os | 5 | .Os |
6 | .Sh NAME | 6 | .Sh NAME |
@@ -300,10 +300,10 @@ algorithm. | |||
300 | There are two phases to the use of DES encryption. | 300 | There are two phases to the use of DES encryption. |
301 | The first is the generation of a | 301 | The first is the generation of a |
302 | .Vt DES_key_schedule | 302 | .Vt DES_key_schedule |
303 | from a key, the second is the actual encryption. | 303 | from a key, and the second is the actual encryption. |
304 | A DES key is of type | 304 | A DES key is of type |
305 | .Vt DES_cblock . | 305 | .Vt DES_cblock . |
306 | This type is consists of 8 bytes with odd parity. | 306 | This type consists of 8 bytes with odd parity. |
307 | The least significant bit in each byte is the parity bit. | 307 | The least significant bit in each byte is the parity bit. |
308 | The key schedule is an expanded form of the key; it is used to speed the | 308 | The key schedule is an expanded form of the key; it is used to speed the |
309 | encryption process. | 309 | encryption process. |
@@ -343,7 +343,7 @@ sets the parity of the passed | |||
343 | to odd. | 343 | to odd. |
344 | .Pp | 344 | .Pp |
345 | .Fn DES_is_weak_key | 345 | .Fn DES_is_weak_key |
346 | returns 1 is the passed key is a weak key, 0 if it is ok. | 346 | returns 1 if the passed key is a weak key or 0 if it is ok. |
347 | .Pp | 347 | .Pp |
348 | The following routines mostly operate on an input and output stream of | 348 | The following routines mostly operate on an input and output stream of |
349 | .Vt DES_cblock Ns s. | 349 | .Vt DES_cblock Ns s. |
@@ -364,7 +364,7 @@ argument is non-zero | |||
364 | .Pq Dv DES_ENCRYPT , | 364 | .Pq Dv DES_ENCRYPT , |
365 | the | 365 | the |
366 | .Fa input | 366 | .Fa input |
367 | (cleartext) is encrypted in to the | 367 | (cleartext) is encrypted into the |
368 | .Fa output | 368 | .Fa output |
369 | (ciphertext) using the key_schedule specified by the | 369 | (ciphertext) using the key_schedule specified by the |
370 | .Fa schedule | 370 | .Fa schedule |
@@ -435,7 +435,7 @@ It uses | |||
435 | .Fa inw | 435 | .Fa inw |
436 | and | 436 | and |
437 | .Fa outw | 437 | .Fa outw |
438 | to 'whiten' the encryption. | 438 | to "whiten" the encryption. |
439 | .Fa inw | 439 | .Fa inw |
440 | and | 440 | and |
441 | .Fa outw | 441 | .Fa outw |
@@ -465,7 +465,7 @@ Its parameters are the same as | |||
465 | .Pp | 465 | .Pp |
466 | .Fn DES_cfb_encrypt | 466 | .Fn DES_cfb_encrypt |
467 | encrypt/decrypts using cipher feedback mode. | 467 | encrypt/decrypts using cipher feedback mode. |
468 | This method takes an array of characters as input and outputs and array | 468 | This method takes an array of characters as input and outputs an array |
469 | of characters. | 469 | of characters. |
470 | It does not require any padding to 8 character groups. | 470 | It does not require any padding to 8 character groups. |
471 | Note: the | 471 | Note: the |
@@ -484,7 +484,7 @@ Because this routine will allow you to encrypt an arbitrary number of | |||
484 | bytes, no 8 byte padding. | 484 | bytes, no 8 byte padding. |
485 | Each call to this routine will encrypt the input bytes to output and | 485 | Each call to this routine will encrypt the input bytes to output and |
486 | then update ivec and num. | 486 | then update ivec and num. |
487 | num contains 'how far' we are though ivec. | 487 | num contains "how far" we are though ivec. |
488 | If this does not make much sense, read more about cfb mode of DES :-). | 488 | If this does not make much sense, read more about cfb mode of DES :-). |
489 | .Pp | 489 | .Pp |
490 | .Fn DES_ede3_cfb64_encrypt | 490 | .Fn DES_ede3_cfb64_encrypt |
@@ -496,7 +496,7 @@ except that Triple-DES is used. | |||
496 | .Pp | 496 | .Pp |
497 | .Fn DES_ofb_encrypt | 497 | .Fn DES_ofb_encrypt |
498 | encrypts using output feedback mode. | 498 | encrypts using output feedback mode. |
499 | This method takes an array of characters as input and outputs and array | 499 | This method takes an array of characters as input and outputs an array |
500 | of characters. | 500 | of characters. |
501 | It does not require any padding to 8 character groups. | 501 | It does not require any padding to 8 character groups. |
502 | Note: the | 502 | Note: the |
@@ -523,7 +523,7 @@ The following functions are included in the DES library for | |||
523 | compatibility with the MIT Kerberos library. | 523 | compatibility with the MIT Kerberos library. |
524 | .Pp | 524 | .Pp |
525 | .Fn DES_cbc_cksum | 525 | .Fn DES_cbc_cksum |
526 | produces an 8 byte checksum based on the input stream (via CBC | 526 | produces an 8-byte checksum based on the input stream (via CBC |
527 | encryption). | 527 | encryption). |
528 | The last 4 bytes of the checksum are returned and the complete 8 bytes | 528 | The last 4 bytes of the checksum are returned and the complete 8 bytes |
529 | are placed in | 529 | are placed in |
@@ -535,7 +535,7 @@ etc. instead. | |||
535 | .Pp | 535 | .Pp |
536 | .Fn DES_quad_cksum | 536 | .Fn DES_quad_cksum |
537 | is a Kerberos v4 function. | 537 | is a Kerberos v4 function. |
538 | It returns a 4 byte checksum from the input bytes. | 538 | It returns a 4-byte checksum from the input bytes. |
539 | The algorithm can be iterated over the input, depending on | 539 | The algorithm can be iterated over the input, depending on |
540 | .Fa out_count , | 540 | .Fa out_count , |
541 | 1, 2, 3 or 4 times. | 541 | 1, 2, 3 or 4 times. |
@@ -606,12 +606,12 @@ for the key schedule and | |||
606 | .Fa iv | 606 | .Fa iv |
607 | for the initial vector. | 607 | for the initial vector. |
608 | .Pp | 608 | .Pp |
609 | .Sy Warning: | 609 | .Sy Warning : |
610 | The data format used by | 610 | The data format used by |
611 | .Fn DES_enc_write | 611 | .Fn DES_enc_write |
612 | and | 612 | and |
613 | .Fn DES_enc_read | 613 | .Fn DES_enc_read |
614 | has a cryptographic weakness: When asked to write more than | 614 | has a cryptographic weakness: when asked to write more than |
615 | .Dv MAXWRITE | 615 | .Dv MAXWRITE |
616 | bytes, | 616 | bytes, |
617 | .Fn DES_enc_write | 617 | .Fn DES_enc_write |
@@ -657,7 +657,7 @@ were added in OpenSSL 0.9.5. | |||
657 | .Fn des_init_random_number_generator , | 657 | .Fn des_init_random_number_generator , |
658 | .Fn des_new_random_key , | 658 | .Fn des_new_random_key , |
659 | .Fn des_set_random_generator_seed , | 659 | .Fn des_set_random_generator_seed , |
660 | .Xr des_set_sequence_number , | 660 | .Fn des_set_sequence_number , |
661 | and | 661 | and |
662 | .Fn des_rand_data 3 | 662 | .Fn des_rand_data 3 |
663 | are used in newer versions of Kerberos but are not implemented here. | 663 | are used in newer versions of Kerberos but are not implemented here. |
@@ -671,8 +671,7 @@ prior version 0.9.5, as well as in the original MIT library. | |||
671 | Single-key DES is insecure due to its short key size. | 671 | Single-key DES is insecure due to its short key size. |
672 | ECB mode is not suitable for most applications. | 672 | ECB mode is not suitable for most applications. |
673 | .Sh BUGS | 673 | .Sh BUGS |
674 | .Xr DES_cbc_encrypt 3 | 674 | DES_cbc_encrypt does not modify |
675 | does not modify | ||
676 | .Fa ivec ; | 675 | .Fa ivec ; |
677 | use | 676 | use |
678 | .Fn DES_ncbc_encrypt | 677 | .Fn DES_ncbc_encrypt |
@@ -689,7 +688,7 @@ The second 12 bits will have the low 8 bits taken from the 3rd input | |||
689 | byte and the top 4 bits taken from the 4th input byte. | 688 | byte and the top 4 bits taken from the 4th input byte. |
690 | The same holds for output. | 689 | The same holds for output. |
691 | This function has been implemented this way because most people will be | 690 | This function has been implemented this way because most people will be |
692 | using a multiple of 8 and because once you get into pulling bytes input | 691 | using a multiple of 8 and because once you get into pulling input |
693 | bytes apart things get ugly! | 692 | bytes apart things get ugly! |
694 | .Pp | 693 | .Pp |
695 | .Fn DES_string_to_key | 694 | .Fn DES_string_to_key |