Test vectors¶
Testing the correctness of the primitives implemented in each cryptography
backend requires trusted test vectors. Where possible these vectors are
obtained from official sources such as NIST or IETF RFCs. When this is
not possible cryptography has chosen to create a set of custom vectors
using an official vector file as input to verify consistency between
implemented backends.
Vectors are kept in the cryptography_vectors package rather than within our
main test suite.
Sources¶
Project Wycheproof¶
We run vectors from Project Wycheproof – a collection of known edge-cases
for various cryptographic algorithms. These are not included in the repository
(or cryptography_vectors package), but rather cloned from Git in our
continuous integration environments.
We have ensured all test vectors are used as of commit
c313761979d74b0417230eddd0f87d0cfab2b46b.
Asymmetric ciphers¶
RSA PKCS #1 from the RSA FTP site (ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/ and ftp://ftp.rsa.com/pub/rsalabs/tmp/).
RSA FIPS 186-2 and PKCS1 v1.5 vulnerability test vectors from NIST CAVP.
FIPS 186-2 and FIPS 186-3 DSA test vectors from NIST CAVP.
FIPS 186-2 and FIPS 186-3 ECDSA test vectors from NIST CAVP.
DH and ECDH and ECDH+KDF(17.4) test vectors from NIST CAVP.
Ed25519 test vectors from the Ed25519 website_.
OpenSSL PEM RSA serialization vectors from the OpenSSL example key and GnuTLS key parsing tests.
OpenSSL PEM DSA serialization vectors from the GnuTLS example keys.
PKCS #8 PEM serialization vectors from
GnuTLS: enc-rsa-pkcs8.pem, enc2-rsa-pkcs8.pem, unenc-rsa-pkcs8.pem, pkcs12_s2k_pem.c. The encoding error in unenc-rsa-pkcs8.pem was fixed, and the contents of enc-rsa-pkcs8.pem was re-encrypted to include it. The contents of enc2-rsa-pkcs8.pem was re-encrypted using a stronger PKCS#8 cipher.
asymmetric/public/PKCS1/dsa.pub.pem is a PKCS1 DSA public key from the Ruby test suite.
X25519 and X448 test vectors from RFC 7748.
RSA OAEP with custom label from the BoringSSL evp tests.
Ed448 test vectors from RFC 8032.
Custom asymmetric vectors¶
asymmetric/PEM_Serialization/ec_private_key.pemandasymmetric/DER_Serialization/ec_private_key.der- Contains an Elliptic Curve key generated by OpenSSL from the curvesecp256r1.asymmetric/PEM_Serialization/ec_private_key_encrypted.pemandasymmetric/DER_Serialization/ec_private_key_encrypted.der- Contains the same Elliptic Curve key asec_private_key.pem, except that it is encrypted with AES-128 with the password “123456”.asymmetric/PEM_Serialization/ec_public_key.pemandasymmetric/DER_Serialization/ec_public_key.der- Contains the public key corresponding toec_private_key.pem, generated using OpenSSL.asymmetric/PEM_Serialization/rsa_private_key.pem- Contains an RSA 2048 bit key generated using OpenSSL, protected by the secret “123456” with DES3 encryption.asymmetric/PEM_Serialization/rsa_public_key.pemandasymmetric/DER_Serialization/rsa_public_key.der- Contains an RSA 2048 bit public generated using OpenSSL fromrsa_private_key.pem.asymmetric/PEM_Serialization/dsaparam.pem- Contains 2048-bit DSA parameters generated using OpenSSL; contains no keys.asymmetric/PEM_Serialization/dsa_private_key.pem- Contains a DSA 2048 bit key generated using OpenSSL from the parameters indsaparam.pem, protected by the secret “123456” with DES3 encryption.asymmetric/PEM_Serialization/dsa_public_key.pemandasymmetric/DER_Serialization/dsa_public_key.der- Contains a DSA 2048 bit key generated using OpenSSL fromdsa_private_key.pem.asymmetric/DER_Serialization/dsa_public_key_no_params.der- Contains a DSA public key with the optional parameters removed.asymmetric/DER_Serialization/dsa_public_key_invalid_bit_string.der- Contains a DSA public key with the bit string padding value set to 2 rather than the required 0.asymmetric/PKCS8/unenc-dsa-pkcs8.pemandasymmetric/DER_Serialization/unenc-dsa-pkcs8.der- Contains a DSA 1024 bit key generated using OpenSSL.asymmetric/PKCS8/unenc-dsa-pkcs8.pub.pemandasymmetric/DER_Serialization/unenc-dsa-pkcs8.pub.der- Contains a DSA 2048 bit public key generated using OpenSSL fromunenc-dsa-pkcs8.pem.DER conversions of the GnuTLS example keys for DSA as well as the OpenSSL example key for RSA.
DER conversions of enc-rsa-pkcs8.pem, enc2-rsa-pkcs8.pem, and unenc-rsa-pkcs8.pem.
asymmetric/public/PKCS1/rsa.pub.pemandasymmetric/public/PKCS1/rsa.pub.derare PKCS1 conversions of the public key fromasymmetric/PKCS8/unenc-rsa-pkcs8.pemusing PEM and DER encoding.x509/custom/ca/ca_key.pem- An unencrypted PCKS8secp256r1key. It is the private key for the certificatex509/custom/ca/ca.pem. This key is encoded in several of the PKCS12 custom vectors.asymmetric/EC/compressed_points.txt- Contains compressed public points generated using OpenSSL.asymmetric/X448/x448-pkcs8-enc.pemandasymmetric/X448/x448-pkcs8-enc.dercontain an X448 key encrypted with AES 256 CBC with the passwordpassword.asymmetric/X448/x448-pkcs8.pemandasymmetric/X448/x448-pkcs8.dercontain an unencrypted X448 key.asymmetric/X448/x448-pub.pemandasymmetric/X448/x448-pub.dercontain an X448 public key.asymmetric/Ed25519/ed25519-pkcs8-enc.pemandasymmetric/Ed25519/ed25519-pkcs8-enc.dercontain an Ed25519 key encrypted with AES 256 CBC with the passwordpassword.asymmetric/Ed25519/ed25519-pkcs8.pemandasymmetric/Ed25519/ed25519-pkcs8.dercontain an unencrypted Ed25519 key.asymmetric/Ed25519/ed25519-pub.pemandasymmetric/Ed25519/ed25519-pub.dercontain an Ed25519 public key.asymmetric/X25519/x25519-pkcs8-enc.pemandasymmetric/X25519/x25519-pkcs8-enc.dercontain an X25519 key encrypted with AES 256 CBC with the passwordpassword.asymmetric/X25519/x25519-pkcs8.pemandasymmetric/X25519/x25519-pkcs8.dercontain an unencrypted X25519 key.asymmetric/X25519/x25519-pub.pemandasymmetric/X25519/x25519-pub.dercontain an X25519 public key.asymmetric/Ed448/ed448-pkcs8-enc.pemandasymmetric/Ed448/ed448-pkcs8-enc.dercontain an Ed448 key encrypted with AES 256 CBC with the passwordpassword.asymmetric/Ed448/ed448-pkcs8.pemandasymmetric/Ed448/ed448-pkcs8.dercontain an unencrypted Ed448 key.asymmetric/Ed448/ed448-pub.pemandasymmetric/Ed448/ed448-pub.dercontain an Ed448 public key.
Key exchange¶
vectors/cryptography_vectors/asymmetric/DH/rfc3526.txtcontains several standardized Diffie-Hellman groups from RFC 3526.vectors/cryptography_vectors/asymmetric/DH/RFC5114.txtcontains Diffie-Hellman examples from appendix A.1, A.2 and A.3 of RFC 5114.vectors/cryptography_vectors/asymmetric/DH/vec.txtcontains Diffie-Hellman examples from botan.vectors/cryptography_vectors/asymmetric/DH/bad_exchange.txtcontains Diffie-Hellman vector pairs that were generated using OpenSSLDH_generate_parameters_exandDH_generate_key.vectors/cryptography_vectors/asymmetric/DH/dhp.pem,vectors/cryptography_vectors/asymmetric/DH/dhkey.pemandvectors/cryptography_vectors/asymmetric/DH/dhpub.pemcontains Diffie-Hellman parameters and key respectively. The keys were generated using OpenSSL following DHKE guide.vectors/cryptography_vectors/asymmetric/DH/dhkey.txtcontains all parameter in text.vectors/cryptography_vectors/asymmetric/DH/dhp.der,vectors/cryptography_vectors/asymmetric/DH/dhkey.derandvectors/cryptography_vectors/asymmetric/DH/dhpub.dercontains are the above parameters and keys in DER format.vectors/cryptography_vectors/asymmetric/DH/dhp_rfc5114_2.pem,vectors/cryptography_vectors/asymmetric/DH/dhkey_rfc5114_2.pemandvectors/cryptography_vectors/asymmetric/DH/dhpub_rfc5114_2.pemcontains Diffie-Hellman parameters and key respectively. The keys were generated using OpenSSL following DHKE guide. When creating the parameters we added the -pkeyopt dh_rfc5114:2 option to use RFC 5114 2048 bit DH parameters with 224 bit subgroup.vectors/cryptography_vectors/asymmetric/DH/dhkey_rfc5114_2.txtcontains all parameter in text.vectors/cryptography_vectors/asymmetric/DH/dhp_rfc5114_2.der,vectors/cryptography_vectors/asymmetric/DH/dhkey_rfc5114_2.derandvectors/cryptography_vectors/asymmetric/DH/dhpub_rfc5114_2.dercontains are the above parameters and keys in DER format.vectors/cryptoraphy_vectors/asymmetric/ECDH/brainpool.txtcontains Brainpool vectors from RFC 7027.
X.509¶
PKITS test suite from NIST PKI Testing.
v1_cert.pemfrom the OpenSSL source tree (testx509.pem).ecdsa_root.pem- DigiCert Global Root G3, asecp384r1ECDSA root certificate.verisign-md2-root.pem- A legacy Verisign public root signed using the MD2 algorithm. This is a PEM conversion of the root data in the NSS source tree.cryptography.io.pem- A leaf certificate issued by RapidSSL for the cryptography website.rapidssl_sha256_ca_g3.pem- The intermediate CA that issued thecryptography.io.pemcertificate.cryptography.io.precert.pem- A pre-certificate with the CT poison extension for the cryptography website.cryptography-scts.io.pem- A leaf certificate issued by Let’s Encrypt for the cryptography website which contains signed certificate timestamps.wildcard_san.pem- A leaf certificate issued by a public CA forlangui.shthat contains wildcard entries in the SAN extension.san_edipartyname.der- A DSA certificate from a Mozilla bug containing a SAN extension with anediPartyNamegeneral name.san_x400address.der- A DSA certificate from a Mozilla bug containing a SAN extension with anx400Addressgeneral name.department-of-state-root.pem- The intermediary CA for the Department of State, issued by the United States Federal Government’s Common Policy CA. Notably has acriticalpolicy constraints extensions.e-trust.ru.der- A certificate from a Russian CA signed using the GOST cipher and containing numerous unusual encodings such as NUMERICSTRING in the subject DN.alternate-rsa-sha1-oid.pem- A certificate from an unknown signature OID Mozilla bug that uses an alternate signature OID for RSA with SHA1.badssl-sct.pem- A certificate with the certificate transparency signed certificate timestamp extension.bigoid.pem- A certificate with a rather long OID in the Certificate Policies extension. We need to make sure we can parse long OIDs.wosign-bc-invalid.pem- A certificate issued by WoSign that contains a basic constraints extension with CA set to false and a path length of zero in violation of RFC 5280.tls-feature-ocsp-staple.pem- A certificate issued by Let’s Encrypt that contains a TLS Feature extension with thestatus_requestfeature (commonly known as OCSP Must-Staple).unique-identifier.pem- A certificate containing a distinguished name with anx500UniqueIdentifier.utf8-dnsname.pem- A certificate containing non-ASCII characters in the DNS name entries of the SAN extension.badasn1time.pem- A certificate containing an incorrectly specified UTCTime in its validity->not_after.letsencryptx3.pem- A subordinate certificate used by Let’s Encrypt to issue end entity certificates.ed25519-rfc8410.pem- A certificate containing an X25519 public key with aned25519signature taken from RFC 8410.root-ed25519.pem- Aned25519root certificate (ed25519signature withed25519public key) from the OpenSSL test suite. (root-ed25519.pem)server-ed25519-cert.pem- Aned25519server certificate (RSA signature withed25519public key) from the OpenSSL test suite. (server-ed25519-cert.pem)server-ed448-cert.pem- Aned448server certificate (RSA signature withed448public key) from the OpenSSL test suite. (server-ed448-cert.pem)
Custom X.509 Vectors¶
invalid_version.pem- Contains an RSA 2048 bit certificate with the X.509 version field set to0x7.post2000utctime.pem- Contains an RSA 2048 bit certificate with thenotBeforeandnotAfterfields encoded as post-2000UTCTime.dsa_selfsigned_ca.pem- Contains a DSA self-signed CA certificate generated using OpenSSL.ec_no_named_curve.pem- Contains an ECDSA certificate that does not have an embedded OID defining the curve.all_supported_names.pem- An RSA 2048 bit certificate generated using OpenSSL that contains a subject and issuer that have two of each supported attribute type from RFC 5280.unsupported_subject_name.pem- An RSA 2048 bit self-signed CA certificate generated using OpenSSL that contains the unsupported “initials” name.utf8_common_name.pem- An RSA 2048 bit self-signed CA certificate generated using OpenSSL that contains a UTF8String common name with the value “We heart UTF8!™”.two_basic_constraints.pem- An RSA 2048 bit self-signed certificate containing two basic constraints extensions.basic_constraints_not_critical.pem- An RSA 2048 bit self-signed certificate containing a basic constraints extension that is not marked as critical.bc_path_length_zero.pem- An RSA 2048 bit self-signed certificate containing a basic constraints extension with a path length of zero.unsupported_extension.pem- An RSA 2048 bit self-signed certificate containing an unsupported extension type. The OID was encoded as “1.2.3.4” with anextnValueof “value”.unsupported_extension_2.pem- Asecp256r1certificate containing two unsupported extensions. The OIDs are1.3.6.1.4.1.41482.2with anextnValueof1.3.6.1.4.1.41482.1.2and1.3.6.1.4.1.45724.2.1.1with anextnValueof\x03\x02\x040unsupported_extension_critical.pem- An RSA 2048 bit self-signed certificate containing an unsupported extension type marked critical. The OID was encoded as “1.2.3.4” with anextnValueof “value”.san_email_dns_ip_dirname_uri.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with the following general names:rfc822Name,dNSName,iPAddress,directoryName, anduniformResourceIdentifier.san_empty_hostname.pem- An RSA 2048 bit self-signed certificate containing a subject alternative extension with an emptydNSNamegeneral name.san_other_name.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with theotherNamegeneral name.san_registered_id.pem- An RSA 1024 bit certificate containing a subject alternative name extension with theregisteredIDgeneral name.all_key_usages.pem- An RSA 2048 bit self-signed certificate containing a key usage extension with all nine purposes set to true.extended_key_usage.pem- An RSA 2048 bit self-signed certificate containing an extended key usage extension with eight usages.san_idna_names.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension withrfc822Name,dNSName, anduniformResourceIdentifiergeneral names with IDNA (RFC 5895) encoding.san_wildcard_idna.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with adNSNamegeneral name with a wildcard IDNA (RFC 5895) domain.san_idna2003_dnsname.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with an IDNA 2003 (RFC 3490)dNSName.san_rfc822_names.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with variousrfc822Namevalues.san_rfc822_idna.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with an IDNArfc822Name.san_uri_with_port.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with variousuniformResourceIdentifiervalues.san_ipaddr.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with aniPAddressvalue.san_dirname.pem- An RSA 2048 bit self-signed certificate containing a subject alternative name extension with adirectoryNamevalue.inhibit_any_policy_5.pem- An RSA 2048 bit self-signed certificate containing an inhibit any policy extension with the value 5.inhibit_any_policy_negative.pem- An RSA 2048 bit self-signed certificate containing an inhibit any policy extension with the value -1.authority_key_identifier.pem- An RSA 2048 bit self-signed certificate containing an authority key identifier extension with key identifier, authority certificate issuer, and authority certificate serial number fields.authority_key_identifier_no_keyid.pem- An RSA 2048 bit self-signed certificate containing an authority key identifier extension with authority certificate issuer and authority certificate serial number fields.aia_ocsp_ca_issuers.pem- An RSA 2048 bit self-signed certificate containing an authority information access extension with two OCSP and one CA issuers entry.aia_ocsp.pem- An RSA 2048 bit self-signed certificate containing an authority information access extension with an OCSP entry.aia_ca_issuers.pem- An RSA 2048 bit self-signed certificate containing an authority information access extension with a CA issuers entry.cdp_empty_hostname.pem- An RSA 2048 bit self-signed certificate containing a CRL distribution point extension withfullNameURI without a hostname.cdp_fullname_reasons_crl_issuer.pem- An RSA 1024 bit certificate containing a CRL distribution points extension withfullName,cRLIssuer, andreasonsdata.cdp_crl_issuer.pem- An RSA 1024 bit certificate containing a CRL distribution points extension withcRLIssuerdata.cdp_all_reasons.pem- An RSA 1024 bit certificate containing a CRL distribution points extension with allreasonsbits set.cdp_reason_aa_compromise.pem- An RSA 1024 bit certificate containing a CRL distribution points extension with theAACompromisereasonsbit set.nc_permitted_excluded.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with both permitted and excluded elements. ContainsIPv4andIPv6addresses with network mask as well asdNSNamewith a leading period.nc_permitted_excluded_2.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with both permitted and excluded elements. Unlikenc_permitted_excluded.pem, the general names do not contain any name constraints specific values.nc_permitted.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with permitted elements.nc_permitted_2.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with permitted elements that do not contain any name constraints specific values.nc_excluded.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with excluded elements.nc_invalid_ip_netmask.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with a permitted element that has anIPv6IP and an invalid network mask.nc_single_ip_netmask.pem- An RSA 2048 bit self-signed certificate containing a name constraints extension with a permitted element that has two IPs with/32and/128network masks.cp_user_notice_with_notice_reference.pem- An RSA 2048 bit self-signed certificate containing a certificate policies extension with a notice reference in the user notice.cp_user_notice_with_explicit_text.pem- An RSA 2048 bit self-signed certificate containing a certificate policies extension with explicit text and no notice reference.cp_cps_uri.pem- An RSA 2048 bit self-signed certificate containing a certificate policies extension with a CPS URI and no user notice.cp_user_notice_no_explicit_text.pem- An RSA 2048 bit self-signed certificate containing a certificate policies extension with a user notice with no explicit text.cp_invalid.pem- An RSA 2048 bit self-signed certificate containing a certificate policies extension with invalid data.ian_uri.pem- An RSA 2048 bit certificate containing an issuer alternative name extension with aURIgeneral name.ocsp_nocheck.pem- An RSA 2048 bit self-signed certificate containing anOCSPNoCheckextension.pc_inhibit_require.pem- An RSA 2048 bit self-signed certificate containing a policy constraints extension with both inhibit policy mapping and require explicit policy elements.pc_inhibit.pem- An RSA 2048 bit self-signed certificate containing a policy constraints extension with an inhibit policy mapping element.pc_require.pem- An RSA 2048 bit self-signed certificate containing a policy constraints extension with a require explicit policy element.unsupported_subject_public_key_info.pem- A certificate whose public key is an unknown OID (1.3.6.1.4.1.8432.1.1.2).policy_constraints_explicit.pem- A self-signed certificate containing apolicyConstraintsextension with arequireExplicitPolicyvalue.freshestcrl.pem- A self-signed certificate containing afreshestCRLextension.ca/ca.pem- A self-signed certificate withbasicConstraintsset to true. Its private key isca/ca_key.pem. This certificate is encoded in several of the PKCS12 custom vectors.negative_serial.pem- A certificate with a serial number that is a negative number.rsa_pss.pem- A certificate with an RSA PSS signature.root-ed448.pem- Aned448self-signed CA certificate usinged448-pkcs8.pemas key.
Custom X.509 Request Vectors¶
dsa_sha1.pemanddsa_sha1.der- Contain a certificate request using 1024-bit DSA parameters and SHA1 generated using OpenSSL.rsa_md4.pemandrsa_md4.der- Contain a certificate request using 2048 bit RSA and MD4 generated using OpenSSL.rsa_sha1.pemandrsa_sha1.der- Contain a certificate request using 2048 bit RSA and SHA1 generated using OpenSSL.rsa_sha256.pemandrsa_sha256.der- Contain a certificate request using 2048 bit RSA and SHA256 generated using OpenSSL.ec_sha256.pemandec_sha256.der- Contain a certificate request using EC (secp384r1) and SHA256 generated using OpenSSL.san_rsa_sha1.pemandsan_rsa_sha1.der- Contain a certificate request using RSA and SHA1 with a subject alternative name extension generated using OpenSSL.two_basic_constraints.pem- A certificate signing request for an RSA 2048 bit key containing two basic constraints extensions.unsupported_extension.pem- A certificate signing request for an RSA 2048 bit key containing containing an unsupported extension type. The OID was encoded as “1.2.3.4” with anextnValueof “value”.unsupported_extension_critical.pem- A certificate signing request for an RSA 2048 bit key containing containing an unsupported extension type marked critical. The OID was encoded as “1.2.3.4” with anextnValueof “value”.basic_constraints.pem- A certificate signing request for an RSA 2048 bit key containing a basic constraints extension marked as critical.invalid_signature.pem- A certificate signing request for an RSA 1024 bit key containing an invalid signature with correct padding.challenge.pem- A certificate signing request for an RSA 2048 bit key containing a challenge password.
Custom X.509 Certificate Revocation List Vectors¶
crl_all_reasons.pem- Contains a CRL with 12 revoked certificates, whose serials match their list position. It includes one revocation without any entry extensions, 10 revocations with every supported reason code and one revocation with an unsupported, non-critical entry extension with the OID value set to “1.2.3.4”.crl_dup_entry_ext.pem- Contains a CRL with one revocation which has a duplicate entry extension.crl_md2_unknown_crit_entry_ext.pem- Contains a CRL with one revocation which contains an unsupported critical entry extension with the OID value set to “1.2.3.4”. The CRL uses an unsupported MD2 signature algorithm.crl_unsupported_reason.pem- Contains a CRL with one revocation which has an unsupported reason code.crl_inval_cert_issuer_entry_ext.pem- Contains a CRL with one revocation which has one entry extension for certificate issuer with an empty value.crl_empty.pem- Contains a CRL with no revoked certificates.crl_ian_aia_aki.pem- Contains a CRL withIssuerAlternativeName,AuthorityInformationAccess,AuthorityKeyIdentifierandCRLNumberextensions.valid_signature.pem- Contains a CRL with the public key which was used to generate it.invalid_signature.pem- Contains a CRL with the last signature byte incremented by 1 to produce an invalid signature, and the public key which was used to generate it.crl_delta_crl_indicator.pem- Contains a CRL with theDeltaCRLIndicatorextension.crl_idp_fullname_only.pem- Contains a CRL with anIssuingDistributionPointsextension with only afullnamefor the distribution point.crl_idp_only_ca.pem- Contains a CRL with anIssuingDistributionPointsextension that is only valid for CA certificate revocation.crl_idp_fullname_only_aa.pem- Contains a CRL with anIssuingDistributionPointsextension that sets afullnameand is only valid for attribute certificate revocation.crl_idp_fullname_only_user.pem- Contains a CRL with anIssuingDistributionPointsextension that sets afullnameand is only valid for user certificate revocation.crl_idp_fullname_indirect_crl.pem- Contains a CRL with anIssuingDistributionPointsextension that sets afullnameand the indirect CRL flag.crl_idp_reasons_only.pem- Contains a CRL with anIssuingDistributionPointsextension that is only valid for revocations with thekeyCompromisereason.crl_idp_relative_user_all_reasons.pem- Contains a CRL with anIssuingDistributionPointsextension that sets all revocation reasons as allowed.crl_idp_relativename_only.pem- Contains a CRL with anIssuingDistributionPointsextension with only arelativenamefor the distribution point.
X.509 OCSP Test Vectors¶
x509/ocsp/resp-sha256.der- An OCSP response forcryptography.iowith a SHA256 signature.x509/ocsp/resp-unauthorized.der- An OCSP response with an unauthorized status.x509/ocsp/resp-revoked.der- An OCSP response forrevoked.badssl.comwith a revoked status.x509/ocsp/resp-delegate-unknown-cert.der- An OCSP response for an unknown cert fromAC Camerafirma. This response also contains a delegate certificate.x509/ocsp/resp-responder-key-hash.der- An OCSP response from theDigiCertOCSP responder that uses a key hash for the responder ID.x509/ocsp/resp-revoked-reason.der- An OCSP response from theQuoVadisOCSP responder that contains a revoked certificate with a revocation reason.x509/ocsp/resp-revoked-no-next-update.der- An OCSP response that contains a revoked certificate and nonextUpdatevalue.x509/ocsp/resp-invalid-signature-oid.der- An OCSP response that was modified to contain an MD2 signature algorithm object identifier.x509/ocsp/resp-single-extension-reason.der- An OCSP response that contains aCRLReasonsingle extension.x509/ocsp/resp-sct-extension.der- An OCSP response containing aCT Certificate SCTssingle extension, from the SwissSign OCSP responder.
Custom X.509 OCSP Test Vectors¶
x509/ocsp/req-sha1.der- An OCSP request containing a single request and using SHA1 as the hash algorithm.x509/ocsp/req-multi-sha1.der- An OCSP request containing multiple requests.x509/ocsp/req-invalid-hash-alg.der- An OCSP request containing an invalid hash algorithm OID.x509/ocsp/req-ext-nonce.der- An OCSP request containing a nonce extension.
Custom PKCS12 Test Vectors¶
pkcs12/cert-key-aes256cbc.p12- A PKCS12 file containing a cert (x509/custom/ca/ca.pem) and key (x509/custom/ca/ca_key.pem) both encrypted with AES 256 CBC with the passwordcryptography.pkcs12/cert-none-key-none.p12- A PKCS12 file containing a cert (x509/custom/ca/ca.pem) and key (x509/custom/ca/ca_key.pem) with no encryption. The password (used for integrity checking only) iscryptography.pkcs12/cert-rc2-key-3des.p12- A PKCS12 file containing a cert (x509/custom/ca/ca.pem) encrypted with RC2 and key (x509/custom/ca/ca_key.pem) encrypted via 3DES with the passwordcryptography.pkcs12/no-password.p12- A PKCS12 file containing a cert (x509/custom/ca/ca.pem) and key (x509/custom/ca/ca_key.pem) with no encryption and no password.pkcs12/no-cert-key-aes256cbc.p12- A PKCS12 file containing a key (x509/custom/ca/ca_key.pem) encrypted via AES 256 CBC with the passwordcryptographyand no certificate.pkcs12/cert-aes256cbc-no-key.p12- A PKCS12 file containing a cert (x509/custom/ca/ca.pem) encrypted via AES 256 CBC with the passwordcryptographyand no private key.
Hashes¶
MD5 from RFC 1321.
RIPEMD160 from the RIPEMD website.
SHA1 from NIST CAVP.
SHA2 (224, 256, 384, 512, 512/224, 512/256) from NIST CAVP.
SHA3 (224, 256, 384, 512) from NIST CAVP.
SHAKE (128, 256) from NIST CAVP.
Blake2s and Blake2b from OpenSSL test/evptests.txt.
HMAC¶
Key derivation functions¶
Key wrapping¶
AES key wrap (AESKW) and 3DES key wrap test vectors from NIST CAVP.
AES key wrap with padding vectors from Botan’s key wrap vectors.
Recipes¶
Fernet from its specification repository.
Symmetric ciphers¶
AES (CBC, CFB, ECB, GCM, OFB, CCM) from NIST CAVP.
AES CTR from RFC 3686.
3DES (CBC, CFB, ECB, OFB) from NIST CAVP.
ARC4 (KEY-LENGTH: 40, 56, 64, 80, 128, 192, 256) from RFC 6229.
ARC4 (KEY-LENGTH: 160) generated by this project. See: ARC4 vector creation
Blowfish (CBC, CFB, ECB, OFB) from Bruce Schneier’s vectors.
Camellia (ECB) from NTT’s Camellia page as linked by CRYPTREC.
Camellia (CBC, CFB, OFB) from OpenSSL’s test vectors.
CAST5 (ECB) from RFC 2144.
CAST5 (CBC, CFB, OFB) generated by this project. See: CAST5 vector creation
ChaCha20 from RFC 7539.
ChaCha20Poly1305 from RFC 7539, OpenSSL’s evpciph.txt, and the BoringSSL ChaCha20Poly1305 tests.
IDEA (ECB) from the NESSIE IDEA vectors created by NESSIE.
IDEA (CBC, CFB, OFB) generated by this project. See: IDEA vector creation
SEED (ECB) from RFC 4269.
SEED (CBC) from RFC 4196.
SEED (CFB, OFB) generated by this project. See: SEED vector creation
Two factor authentication¶
CMAC¶
AES-128, AES-192, AES-256, 3DES from NIST SP-800-38B
Creating test vectors¶
When official vectors are unavailable cryptography may choose to build
its own using existing vectors as source material.
Created Vectors¶
If official test vectors appear in the future the custom generated vectors should be discarded.
Any vectors generated by this method must also be prefixed with the following header format (substituting the correct information):
# CAST5 CBC vectors built for https://github.com/pyca/cryptography
# Derived from the AESVS MMT test data for CBC
# Verified against the CommonCrypto and Go crypto packages
# Key Length : 128