Crypt::...eyChain(3)
π Crypt::DSA::KeyChain π
okay bestie, pull up a chair β this is the Crypt::...eyChain(3) page from your friendly neighbourhood User Contributed Perl Documentation. It's giving "I make DSA keys and I'm lowkey iconic about it." Let's get into it. π
β¨ NAME β¨
Crypt::DSA::KeyChain β the DSA key generation system. that's it, that's the name, slay. π
β¨ SYNOPSIS β¨
bestie here's the whole vibe in code form:
use Crypt::DSA::KeyChain;
my $keychain = Crypt::DSA::KeyChain->new;
my $key = $keychain->generate_params(
Size => 512,
Seed => $seed,
Verbosity => 1,
);
$keychain->generate_keys($key);
like. look at her go. π¦
β¨ DESCRIPTION β¨
Crypt::DSA::KeyChain is the lower-level interface to key generation β the one underneath the interface in Crypt::DSA (you know, the keygen method). It lets you generate the p, q, and g key parameters separately, given an optional starting seed and a mandatory bit size for p. And just so we're clear: q and g are 160 bits each, no negotiating. π
then, once you've got all that, you can call generate_keys to generate the public and private portions of the key. main character energy fr fr. π
β¨ USAGE β¨
π« $keychain = Crypt::DSA::KeyChain->new
Constructs a brand new Crypt::DSA::KeyChain object. ngl, at the moment this isn't particularly useful in itself β it's mostly just the object you need in order to call the other methods. it's giving "I'm here to hold the vibes." π«Ά
Returns the new object. β¨
π« $key = $keychain->generate_params(%arg)
Generates a set of DSA parameters: the p, q, and g values of the key. Heads up though β this involves finding primes, and as such it can be a relatively long process. like, go make a snack. π
When invoked in scalar context</>, it returns a new Crypt::DSA::Key object.
In list context, it returns the new Crypt::DSA::Key object, along with:
- the value of the internal counter when a suitable prime
pwas found; - the value of
hwhengwas derived; - and the value of the seed (a 20-byte string) when
qwas found.
These values aren't particularly useful in normal circumstances, but they could be useful. iykyk. π
%arg can contain:
Sizeβ the size in bits of thepvalue to generate. Theqandgvalues are always 160 bits each.
This argument is mandatory. no Size, no key, periodt. π
Seedβ a seed with whichqgeneration will begin. If this seed does not lead to a suitable prime, it will be discarded, and a new random seed chosen in its place, until a suitable prime can be found.
This is entirely optional, and if not provided a random seed will be generated automatically.
Note: This module now usesCrypt::SysRandomto generate a seed. If you are not using one of the sources of randomness recommended athttps://security.metacpan.org/docs/guides/random-data-for-security.htmlyou should not (must not) provide your ownSeedvalue. π
In particular, Perl'srandfunction must not be used for any session, token, hash, authentication, cryptographic value. Basically do not userandunless you absolutely know how it will be used. seriously. bestie. I'm begging. π
Verbosityβ should be either0or1. A value of1will give you a progress meter duringpandqgeneration β this can be useful, since the process can be relatively long. (see: the snack comment above.)
The default is 0. β¨
π« $keychain->generate_keys($key)
Generates the public and private portions of the key $key, a Crypt::DSA::Key object. the glow-up portion of the program. π
β¨ AUTHOR & COPYRIGHT β¨
Please see the Crypt::DSA manpage for author, copyright, and license information. π«Ά
and that's the page bestie!! π this was brought to you by perl v5.42.2, dated 2026-07-03, and the manual Crypt::...eyChain(3). go forth and generate responsibly, no cap. πβ¨π¦π
π¦ where this page comes from
- fedora 43: perl-Crypt-DSA 1.22-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Crypt-DSA 1.22-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms