⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rsasigkey.8

📁 This a good VPN source
💻 8
字号:
.TH IPSEC_RSASIGKEY 8 "22 July 2001".\" RCSID $Id: rsasigkey.8,v 1.21 2003/06/06 04:19:32 dhr Exp $.SH NAMEipsec rsasigkey \- generate RSA signature key.SH SYNOPSIS.B ipsec.B rsasigkey[.B \-\-verbose] [.B \-\-randomfilename].B \e.br\ \ \ [.B \-\-roundsnr] [.B \-\-hostnamehost ] [.B \-\-noopt] nbits.br.B ipsec.B rsasigkey[.B \-\-verbose] [.B \-\-hostnamehost ].B \e.br\ \ \ [.B \-\-noopt].B \-\-oldkeyfile.SH DESCRIPTION.I Rsasigkeygenerates an RSA public/private key pair,suitable for digital signatures,of (exactly).I nbitsbits (that is, two primes each of exactly.IR nbits /2bits,and related numbers)and emits it on standard output as ASCII (mostly hex) data..I nbitsmust be a multiple of 16..PPThe public exponent is forced to the value.BR 3 ,which has important speed advantages for signature checking.Beware that the resulting keys have known weaknesses as encryption keys\fIand should not be used for that purpose\fR..PPThe.B \-\-verboseoption makes.I rsasigkeygive a running commentary on standard error.By default, it works in silence until it is ready to generate output..PPThe.B \-\-randomoption specifies a source for random bits.The default is.I /dev/random(see.IR random (4)).Normally,.I rsasigkeyreads exactly.I nbitsrandom bits from the source;in extremely-rare circumstances it may need more..PPThe.B \-\-roundsoption specifies the number of rounds to be done by the.I mpz_probab_prime_pprobabilistic primality checker.The default, 30, is fairly rigorous and should not normallyhave to be overridden..PPThe.B \-\-hostnameoption specifies what host name to use inthe first line of the output (see below);the default is what.IR gethostname (2)returns..PPThe.B \-\-nooptoption suppresses an optimization of the private key(to be precise, setting of the decryption exponent to.B lcm(p\-1,q\-1)rather than.BR (p\-1)*(q\-1) )which speeds up operations on it slightlybut can cause it to flunk a validity check in old RSA implementations(notably, obsolete versions of.IR ipsec_pluto (8))..PPThe.B \-\-oldkeyoption specifies that rather than generate a new key,.I rsasigkeyshould read an old key from the.I file(the name.B \-means ``standard input'')and use that to generate its output.Input lines which do not look like.I rsasigkeyoutput are silently ignored.This permits updating old keys to the current format..PPThe output format looks like this (with long numbers trimmed downfor clarity):.PP.ne 15.nf	# RSA 2048 bits   xy.example.com   Sat Apr 15 13:53:22 2000	# for signatures only, UNSAFE FOR ENCRYPTION	#pubkey=0sAQOF8tZ2NZt...Y1P+buFuFn/	Modulus: 0xcc2a86fcf440...cf1011abb82d1	PublicExponent: 0x03	# everything after this point is secret	PrivateExponent: 0x881c59fdf8...ab05c8c77d23	Prime1: 0xf49fd1f779...46504c7bf3	Prime2: 0xd5a9108453...321d43cb2b	Exponent1: 0xa31536a4fb...536d98adda7f7	Exponent2: 0x8e70b5ad8d...9142168d7dcc7	Coefficient: 0xafb761d001...0c13e98d98.fi.PPThe first (comment) line,indicating the nature and date of the key,and giving a host name,is used by.IR ipsec_showhostkey (8)when generating some forms of key output..PPThe commented-out.B pubkey=line contains the public key\(emthe public exponent and the modulus\(emcombinedin approximately RFC 2537 format(the one deviation is that the combined value is given with a.B 0sprefix, rather than in unadorned base-64),suitable for use in the.I ipsec.conffile..PPThe.BR Modulus ,.BR PublicExponent ,and.B PrivateExponentlines give the basic signing and verification data..PPThe.B Prime1and.B Prime2lines give the primes themselves (aka.I pand.IR q ),largest first.The.B Exponent1and.B Exponent2lines givethe private exponent mod.IR p\-1and.IR q\-1respectively.The.B Coefficientline gives the Chinese Remainder Theorem coefficient,which is the inverse of.IR q ,mod.IR p .These additional numbers (which must all be kept as secret as theprivate exponent) are precomputed aids to rapid signature generation..PPNo attempt is made to break long lines..PPThe US patent on the RSA algorithm expired 20 Sept 2000..SH EXAMPLES.TP.B "ipsec rsasigkey \-\-verbose 2192 >mykey"generates a 2192-bit signature key and puts it in the file.IR mykey ,with running commentary on standard error.The file contents can be inserted verbatim into a suitable entry in the.I ipsec.secretsfile (see.IR ipsec.secrets (5)),and the public key can then be extracted and edited into the.I ipsec.conffile (see.IR ipsec.conf (5))..TP.B "ipsec rsasigkey \-\-verbose \-\-oldkey oldie >latest"takes the old signature key from file.I oldieand puts a version in the current format into the file.IR latest ,with running commentary on standard error..SH FILES/dev/random.SH SEE ALSOrandom(4), ipsec_showhostkey(8).br\fIApplied Cryptography\fR, 2nd. ed., by Bruce Schneier, Wiley 1996..brRFCs 2537, 2313..br\fIGNU MP, the GNU multiple precision arithmetic library, edition 2.0.2\fR,by Torbj Granlund..SH HISTORYWritten for the Linux FreeS/WAN project<http://www.freeswan.org>by Henry Spencer..SH BUGSThere is an internal limit on.IR nbits ,currently 20000..PP.IR Rsasigkey 'srun time is difficult to predict,since.I /dev/randomoutput can be arbitrarily delayed ifthe system's entropy pool is low on randomness,and the time taken by the search for primes is also somewhat unpredictable.A reasonably typical time for a 1024-bit key on a quiet 200MHz Pentium MMXwith plenty of randomness available is 20 seconds,almost all of it in the prime searches.Generating a 2192-bit key on the same system usually takes several minutes.A 4096-bit key took an hour and a half of CPU time..PPThe.B \-\-oldkeyoption does not check its input format as rigorously as it might.Corrupted.I rsasigkeyoutput may confuse it.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -