diff options
| author | schwarze <> | 2022-07-13 17:32:16 +0000 |
|---|---|---|
| committer | schwarze <> | 2022-07-13 17:32:16 +0000 |
| commit | 6b311b4d5a7de7bd609f89b7b3c6d8e19930f3bd (patch) | |
| tree | 4628fc75027444e3e117ab370869f778e1c25f49 /src/lib/libcrypto/man/RSA_security_bits.3 | |
| parent | 365c3fb49e39fda4859948f84c262fc649b1a349 (diff) | |
| download | openbsd-6b311b4d5a7de7bd609f89b7b3c6d8e19930f3bd.tar.gz openbsd-6b311b4d5a7de7bd609f89b7b3c6d8e19930f3bd.tar.bz2 openbsd-6b311b4d5a7de7bd609f89b7b3c6d8e19930f3bd.zip | |
New manual page written from scratch;
tb@ recently added these functions to libcrypto
and also provided feedback on my first draft of this page.
Diffstat (limited to 'src/lib/libcrypto/man/RSA_security_bits.3')
| -rw-r--r-- | src/lib/libcrypto/man/RSA_security_bits.3 | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/RSA_security_bits.3 b/src/lib/libcrypto/man/RSA_security_bits.3 new file mode 100644 index 0000000000..f7024a7956 --- /dev/null +++ b/src/lib/libcrypto/man/RSA_security_bits.3 | |||
| @@ -0,0 +1,137 @@ | |||
| 1 | .\" $OpenBSD: RSA_security_bits.3,v 1.1 2022/07/13 17:32:16 schwarze Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2022 Ingo Schwarze <schwarze@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: July 13 2022 $ | ||
| 18 | .Dt RSA_SECURITY_BITS 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm RSA_security_bits , | ||
| 22 | .Nm DSA_security_bits , | ||
| 23 | .Nm DH_security_bits , | ||
| 24 | .Nm BN_security_bits | ||
| 25 | .Nd get security strength | ||
| 26 | .Sh SYNOPSIS | ||
| 27 | .In openssl/rsa.h | ||
| 28 | .Ft int | ||
| 29 | .Fn RSA_security_bits "const RSA *rsa" | ||
| 30 | .In openssl/dsa.h | ||
| 31 | .Ft int | ||
| 32 | .Fn DSA_security_bits "const DSA *dsa" | ||
| 33 | .In openssl/dh.h | ||
| 34 | .Ft int | ||
| 35 | .Fn DH_security_bits "const DH *dh" | ||
| 36 | .In openssl/bn.h | ||
| 37 | .Ft int | ||
| 38 | .Fo BN_security_bits | ||
| 39 | .Fa "int pubbits" | ||
| 40 | .Fa "int privbits" | ||
| 41 | .Fc | ||
| 42 | .Sh DESCRIPTION | ||
| 43 | These functions return the security strength of some specific types of | ||
| 44 | cryptographic keys, measured in bits. | ||
| 45 | It is approximately the binary logarithm of the number of operations | ||
| 46 | an attacker has to perform in order to break the key. | ||
| 47 | .Pp | ||
| 48 | .Fn RSA_security_bits | ||
| 49 | uses only the number of significant bits in the public modulus of | ||
| 50 | .Fa rsa | ||
| 51 | as returned by | ||
| 52 | .Xr RSA_bits 3 . | ||
| 53 | It returns | ||
| 54 | .Bl -column 256 for 15360 last_column -offset indent | ||
| 55 | .It 256 Ta for Ta 15360 Ta or more significant bits | ||
| 56 | .It 192 Ta Ta 7680 Ta | ||
| 57 | .It 128 Ta Ta 3072 Ta | ||
| 58 | .It 112 Ta Ta 2048 Ta | ||
| 59 | .It 80 Ta Ta 1024 Ta | ||
| 60 | .El | ||
| 61 | .Pp | ||
| 62 | or 0 otherwise. | ||
| 63 | .Pp | ||
| 64 | .Fn DSA_security_bits | ||
| 65 | uses the number of significant bits in the public domain parameter | ||
| 66 | .Fa p | ||
| 67 | contained in the | ||
| 68 | .Fa dsa | ||
| 69 | object, which is equal to the size of the public key, in the same way as | ||
| 70 | .Fn RSA_security_bits . | ||
| 71 | In addition, the public domain parameter | ||
| 72 | .Fa q | ||
| 73 | contained in the | ||
| 74 | .Fa dsa | ||
| 75 | object, which is equal to the size of the private key, is inspected. | ||
| 76 | The return value is either the security strength according to the above table | ||
| 77 | or half the size of the private key, whichever is smaller. | ||
| 78 | If the return value would be smaller than 80, 0 is returned instead. | ||
| 79 | .Pp | ||
| 80 | .Fn DH_security_bits | ||
| 81 | uses the number of significant bits in the shared secret contained in the | ||
| 82 | .Fa dh | ||
| 83 | object as returned by | ||
| 84 | .Xr DH_bits 3 | ||
| 85 | in the same way as | ||
| 86 | .Fn RSA_security_bits . | ||
| 87 | If | ||
| 88 | .Fa dh | ||
| 89 | contains the domain parameter | ||
| 90 | .Fa q , | ||
| 91 | its number of significant bits is used in the same way as for | ||
| 92 | .Fn DSA_security_bits | ||
| 93 | to limit the return value. | ||
| 94 | Otherwise, if | ||
| 95 | .Fa dh | ||
| 96 | contains the length of the secret exponent in bits, | ||
| 97 | that number is used. | ||
| 98 | If neither is available, only the above table is used | ||
| 99 | without calculating a minimum. | ||
| 100 | .Pp | ||
| 101 | .Fn BN_security_bits | ||
| 102 | is a combined function. | ||
| 103 | If \-1 is passed for the | ||
| 104 | .Fa privbits | ||
| 105 | argument, it behaves like | ||
| 106 | .Fn RSA_security_bits . | ||
| 107 | Otherwise, it behaves like | ||
| 108 | .Fn DSA_security_bits . | ||
| 109 | .Sh RETURN VALUES | ||
| 110 | All these functions return numbers in the range from 0 to 256 inclusive. | ||
| 111 | .Pp | ||
| 112 | .Fn DSA_security_bits | ||
| 113 | fails and returns \-1 unless both of the | ||
| 114 | .Fa p | ||
| 115 | and | ||
| 116 | .Fa q | ||
| 117 | domain parameters are present. | ||
| 118 | .Sh SEE ALSO | ||
| 119 | .Xr BN_num_bits 3 , | ||
| 120 | .Xr DH_bits 3 , | ||
| 121 | .Xr DH_get0_pqg 3 , | ||
| 122 | .Xr DSA_get0_pqg 3 , | ||
| 123 | .Xr RSA_bits 3 , | ||
| 124 | .Xr SSL_CTX_set_security_level 3 | ||
| 125 | .Rs | ||
| 126 | .%A Elaine Barker | ||
| 127 | .%T Recommendation for Key Management | ||
| 128 | .%I U.S. National Institute of Standards and Technology | ||
| 129 | .%R NIST Special Publication 800-57 Part 1 Revision 5 | ||
| 130 | .%U https://doi.org/10.6028/NIST.SP.800-57pt1r5 | ||
| 131 | .%C Gaithersburg, MD | ||
| 132 | .%D May 2020 | ||
| 133 | .Re | ||
| 134 | .Sh HISTORY | ||
| 135 | These functions first appeared in OpenSSL 1.1.0 | ||
| 136 | and have been available since | ||
| 137 | .Ox 7.2 . | ||
