summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/DES_set_key.3
diff options
context:
space:
mode:
authorjmc <>2016-11-10 14:34:18 +0000
committerjmc <>2016-11-10 14:34:18 +0000
commitf09d61b594eba5f8f4ebf834ec2f18203636bcf5 (patch)
tree8e5a7bb432fb01e6ee508c5a7327eb41f4a0c92a /src/lib/libcrypto/man/DES_set_key.3
parente19a4e15d73261c4eaf9f544789343e0ae570455 (diff)
downloadopenbsd-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.335
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.
300There are two phases to the use of DES encryption. 300There are two phases to the use of DES encryption.
301The first is the generation of a 301The first is the generation of a
302.Vt DES_key_schedule 302.Vt DES_key_schedule
303from a key, the second is the actual encryption. 303from a key, and the second is the actual encryption.
304A DES key is of type 304A DES key is of type
305.Vt DES_cblock . 305.Vt DES_cblock .
306This type is consists of 8 bytes with odd parity. 306This type consists of 8 bytes with odd parity.
307The least significant bit in each byte is the parity bit. 307The least significant bit in each byte is the parity bit.
308The key schedule is an expanded form of the key; it is used to speed the 308The key schedule is an expanded form of the key; it is used to speed the
309encryption process. 309encryption process.
@@ -343,7 +343,7 @@ sets the parity of the passed
343to odd. 343to odd.
344.Pp 344.Pp
345.Fn DES_is_weak_key 345.Fn DES_is_weak_key
346returns 1 is the passed key is a weak key, 0 if it is ok. 346returns 1 if the passed key is a weak key or 0 if it is ok.
347.Pp 347.Pp
348The following routines mostly operate on an input and output stream of 348The 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 ,
365the 365the
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
436and 436and
437.Fa outw 437.Fa outw
438to 'whiten' the encryption. 438to "whiten" the encryption.
439.Fa inw 439.Fa inw
440and 440and
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
467encrypt/decrypts using cipher feedback mode. 467encrypt/decrypts using cipher feedback mode.
468This method takes an array of characters as input and outputs and array 468This method takes an array of characters as input and outputs an array
469of characters. 469of characters.
470It does not require any padding to 8 character groups. 470It does not require any padding to 8 character groups.
471Note: the 471Note: the
@@ -484,7 +484,7 @@ Because this routine will allow you to encrypt an arbitrary number of
484bytes, no 8 byte padding. 484bytes, no 8 byte padding.
485Each call to this routine will encrypt the input bytes to output and 485Each call to this routine will encrypt the input bytes to output and
486then update ivec and num. 486then update ivec and num.
487num contains 'how far' we are though ivec. 487num contains "how far" we are though ivec.
488If this does not make much sense, read more about cfb mode of DES :-). 488If 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
498encrypts using output feedback mode. 498encrypts using output feedback mode.
499This method takes an array of characters as input and outputs and array 499This method takes an array of characters as input and outputs an array
500of characters. 500of characters.
501It does not require any padding to 8 character groups. 501It does not require any padding to 8 character groups.
502Note: the 502Note: the
@@ -523,7 +523,7 @@ The following functions are included in the DES library for
523compatibility with the MIT Kerberos library. 523compatibility with the MIT Kerberos library.
524.Pp 524.Pp
525.Fn DES_cbc_cksum 525.Fn DES_cbc_cksum
526produces an 8 byte checksum based on the input stream (via CBC 526produces an 8-byte checksum based on the input stream (via CBC
527encryption). 527encryption).
528The last 4 bytes of the checksum are returned and the complete 8 bytes 528The last 4 bytes of the checksum are returned and the complete 8 bytes
529are placed in 529are placed in
@@ -535,7 +535,7 @@ etc. instead.
535.Pp 535.Pp
536.Fn DES_quad_cksum 536.Fn DES_quad_cksum
537is a Kerberos v4 function. 537is a Kerberos v4 function.
538It returns a 4 byte checksum from the input bytes. 538It returns a 4-byte checksum from the input bytes.
539The algorithm can be iterated over the input, depending on 539The algorithm can be iterated over the input, depending on
540.Fa out_count , 540.Fa out_count ,
5411, 2, 3 or 4 times. 5411, 2, 3 or 4 times.
@@ -606,12 +606,12 @@ for the key schedule and
606.Fa iv 606.Fa iv
607for the initial vector. 607for the initial vector.
608.Pp 608.Pp
609.Sy Warning: 609.Sy Warning :
610The data format used by 610The data format used by
611.Fn DES_enc_write 611.Fn DES_enc_write
612and 612and
613.Fn DES_enc_read 613.Fn DES_enc_read
614has a cryptographic weakness: When asked to write more than 614has a cryptographic weakness: when asked to write more than
615.Dv MAXWRITE 615.Dv MAXWRITE
616bytes, 616bytes,
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 ,
661and 661and
662.Fn des_rand_data 3 662.Fn des_rand_data 3
663are used in newer versions of Kerberos but are not implemented here. 663are 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.
671Single-key DES is insecure due to its short key size. 671Single-key DES is insecure due to its short key size.
672ECB mode is not suitable for most applications. 672ECB mode is not suitable for most applications.
673.Sh BUGS 673.Sh BUGS
674.Xr DES_cbc_encrypt 3 674DES_cbc_encrypt does not modify
675does not modify
676.Fa ivec ; 675.Fa ivec ;
677use 676use
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
689byte and the top 4 bits taken from the 4th input byte. 688byte and the top 4 bits taken from the 4th input byte.
690The same holds for output. 689The same holds for output.
691This function has been implemented this way because most people will be 690This function has been implemented this way because most people will be
692using a multiple of 8 and because once you get into pulling bytes input 691using a multiple of 8 and because once you get into pulling input
693bytes apart things get ugly! 692bytes apart things get ugly!
694.Pp 693.Pp
695.Fn DES_string_to_key 694.Fn DES_string_to_key