| 1 | package Crypt::Perl; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | our $VERSION = '0.24-TRIAL4'; | ||
| 7 | |||
| 8 | =encoding utf-8 | ||
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | Crypt::Perl - Cryptography in Pure Perl | ||
| 13 | |||
| 14 | =head1 DESCRIPTION | ||
| 15 | |||
| 16 | Just as it sounds: cryptography with no non-core XS dependencies! | ||
| 17 | This is useful if you don’t have access to | ||
| 18 | other tools that do this work like L<OpenSSL|http://openssl.org>, L<CryptX>, | ||
| 19 | etc. Of course, if you do have access to one of those tools, they may suit | ||
| 20 | your purpose better. | ||
| 21 | |||
| 22 | See submodules for usage examples of: | ||
| 23 | |||
| 24 | =over | ||
| 25 | |||
| 26 | =item * Key generation | ||
| 27 | |||
| 28 | =item * Key parsing | ||
| 29 | |||
| 30 | =item * Signing & verification | ||
| 31 | |||
| 32 | =item * Encryption & decryption | ||
| 33 | |||
| 34 | =item * Import (L<Crypt::Perl::PK>) from & export to L<JSON Web Key|https://tools.ietf.org/html/rfc7517> format | ||
| 35 | |||
| 36 | =item * L<JWK thumbprints|https://tools.ietf.org/html/rfc7638> | ||
| 37 | |||
| 38 | =item * Certificate Signing Request (PKCS #10) generation (L<Crypt::Perl::PKCS10>) | ||
| 39 | |||
| 40 | =item * SSL/TLS certificate (X.509) generation (L<Crypt::Perl::X509v3>), including | ||
| 41 | a broad variety of extensions | ||
| 42 | |||
| 43 | =back | ||
| 44 | |||
| 45 | =head1 SUPPORTED PUBLIC KEY ENCRYPTION ALGORITHMS | ||
| 46 | |||
| 47 | =over | ||
| 48 | |||
| 49 | =item * L<RSA|Crypt::Perl::RSA> | ||
| 50 | |||
| 51 | =item * L<ECDSA|Crypt::Perl::ECDSA> | ||
| 52 | |||
| 53 | =item * L<ECDSA|Crypt::Perl::Ed25519> | ||
| 54 | |||
| 55 | =back | ||
| 56 | |||
| 57 | =head1 SECURITY | ||
| 58 | |||
| 59 | Given the number of original tests in this distribution, I am B<reasonably> | ||
| 60 | confident that this code is as secure as the random number generation in | ||
| 61 | L<Bytes::Random::Secure::Tiny> can allow. The tests verify the logic here | ||
| 62 | against OpenSSL, on which millions of applications rely every day. | ||
| 63 | |||
| 64 | That said: B<NO GUARANTEES!!!> The tests here are original, but the | ||
| 65 | production logic is ported from elsewhere. There has been no formal security | ||
| 66 | review. L<I found at least one security flaw|https://github.com/kjur/jsrsasign/issues/221> | ||
| 67 | in one of the source libraries; there may be more. | ||
| 68 | |||
| 69 | Of course, L<OpenSSL has not been trouble-free, either|https://www.openssl.org/news/vulnerabilities.html>! | ||
| 70 | |||
| 71 | Caveat emptor. | ||
| 72 | |||
| 73 | =head1 SPEED | ||
| 74 | |||
| 75 | RSA key generation is slow—too slow, probably, unless you have | ||
| 76 | L<Math::BigInt::GMP> or L<Math::BigInt::Pari> (either of which requires XS). | ||
| 77 | It’s one application where pure-Perl cryptography just doesn’t seem | ||
| 78 | feasible. :-( Everything else, though, including all ECDSA and Ed25519 | ||
| 79 | operations, should be fine. | ||
| 80 | |||
| 81 | =head1 TODO | ||
| 82 | |||
| 83 | There are TODO items listed in the submodules; the following are general | ||
| 84 | to the entire distribution. | ||
| 85 | |||
| 86 | =over | ||
| 87 | |||
| 88 | =item * Document the exception system so that applications can use it. | ||
| 89 | |||
| 90 | =item * Add more tests, e.g., against L<CryptX>. | ||
| 91 | |||
| 92 | =item * Some formal security audit would be nice. | ||
| 93 | |||
| 94 | =item * Make it faster :) | ||
| 95 | |||
| 96 | =back | ||
| 97 | |||
| 98 | =head1 ACKNOWLEDGEMENTS | ||
| 99 | |||
| 100 | Much of the logic here comes from Kenji Urushima’s L<jsrsasign|https://github.com/kjur/jsrsasign>. | ||
| 101 | |||
| 102 | Most of the tests depend on the near-ubiquitous L<OpenSSL|http://openssl.org>, | ||
| 103 | without which the Internet would be a very, very different reality from | ||
| 104 | what we know! | ||
| 105 | |||
| 106 | The Ed25519 logic is ported from L<forge.js|https://github.com/digitalbazaar/forge/blob/master/lib/ed25519.js>. | ||
| 107 | |||
| 108 | Other parts are ported from L<LibTomCrypt|http://www.libtom.net>. | ||
| 109 | |||
| 110 | =head1 LICENSE | ||
| 111 | |||
| 112 | This library is licensed under the same license as Perl. | ||
| 113 | |||
| 114 | =head1 AUTHOR | ||
| 115 | |||
| 116 | Felipe Gasper (FELIPE) | ||
| 117 | |||
| 118 | =cut | ||
| 119 | |||
| 120 | 1; |