Repository Analysis

pyca/cryptography

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.

16.3 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of pyca/cryptography, a Python project with 7,662 GitHub stars. SynthScan v2.0 examined 308,294 lines of code across 595 source files, recording 3694 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 16.3 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

16.3
Adjusted Score
16.3
Raw Score
100%
Time Factor
2026-07-14
Last Push
7.7K
Stars
Python
Language
308.3K
Lines of Code
595
Files
3.7K
Pattern Hits
2026-07-14
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 8MEDIUM 1472LOW 2214

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 3694 distinct pattern matches across 13 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Decorative Section Separators1240 hits · 2508 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_utils.py718 # =============================================STRING
MEDIUMtests/test_utils.py721 # -----------------------------------STRING
MEDIUMtests/test_utils.py725 # ----------STRING
MEDIUMtests/test_utils.py576 # -----------------------------------STRING
MEDIUMtests/test_utils.py580 # ----------STRING
MEDIUMtests/test_utils.py597 # -----------STRING
MEDIUMtests/test_utils.py659 # -------------------------------------------------------STRING
MEDIUMtests/test_utils.py662 # -----------------STRING
MEDIUMtests/test_utils.py694 # -----------------STRING
MEDIUMtests/test_utils.py745 # -----------STRING
MEDIUMtests/test_utils.py820 # -----------------STRING
MEDIUMtests/test_utils.py840 # =============================================STRING
MEDIUMtests/test_utils.py1049 # -----------------------------------STRING
MEDIUMtests/test_utils.py1053 # ----------STRING
MEDIUMtests/test_utils.py1069 # -----------STRING
MEDIUMtests/test_utils.py1125 # -----------------------------------------------------------STRING
MEDIUMtests/test_utils.py1128 # ------------------STRING
MEDIUMtests/test_utils.py1149 # ------------------STRING
MEDIUMtests/test_utils.py1169 # =============================================STRING
MEDIUMtests/bench/test_x509.py50# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/bench/test_x509.py53# ---------------------------------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt636# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt639# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt643# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt1230# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt1233# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt1237# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt1822# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt1825# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt1829# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt2419# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt2422# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt2426# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt3016# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt3019# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt3023# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt3610# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt3613# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt3617# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt4232# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt4235# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt4239# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt4856# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt4859# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt4863# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt5480# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt5483# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt5487# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt6101# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt6104# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt6108# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt6721# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt6724# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt6728# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt7344# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt7347# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt7351# ----------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt7970# =============================================COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt7973# ---------------------------------------------------COMMENT
MEDIUM…raphy_vectors/asymmetric/RSA/pkcs1v15crypt-vectors.txt7977# ----------COMMENT
1180 more matches not shown…
Hyper-Verbose Identifiers1167 hits · 960 pts
SeverityFileLineSnippetContext
LOWtests/test_utils.py4428def test_raises_unsupported_algorithm_wrong_type():CODE
LOWtests/test_utils.py4438def test_raises_unsupported_algorithm_wrong_reason():CODE
LOWtests/test_utils.py4447def test_raises_unsupported_no_exc():CODE
LOWtests/test_utils.py4454def test_raises_unsupported_algorithm():CODE
LOWtests/test_utils.py42def test_int_to_bytes_rejects_zero_length():CODE
LOWtests/test_utils.py49def test_check_backend_support_skip():CODE
LOWtests/test_utils.py60def test_check_backend_support_no_skip():CODE
LOWtests/test_utils.py137def test_load_nist_vectors_with_null_chars():CODE
LOWtests/test_utils.py246def test_load_cryptrec_vectors():CODE
LOWtests/test_utils.py288def test_load_cryptrec_vectors_invalid():CODE
LOWtests/test_utils.py356def test_load_hash_vectors_bad_data():CODE
LOWtests/test_utils.py370def test_load_vectors_from_file():CODE
LOWtests/test_utils.py389def test_load_nist_gcm_vectors():CODE
LOWtests/test_utils.py1385def test_load_rsa_nist_vectors():CODE
LOWtests/test_utils.py1558def test_load_rsa_nist_pss_verification_vectors():CODE
LOWtests/test_utils.py1624def test_load_fips_dsa_key_pair_vectors():CODE
LOWtests/test_utils.py2035def test_load_fips_dsa_sig_ver_vectors():CODE
LOWtests/test_utils.py2361def test_load_fips_dsa_sig_gen_vectors():CODE
LOWtests/test_utils.py2657def test_load_fips_ecdsa_key_pair_vectors():CODE
LOWtests/test_utils.py2805def test_load_fips_ecdsa_signing_vectors():CODE
LOWtests/test_utils.py2998def test_load_kasvs_dh_vectors():CODE
LOWtests/test_utils.py3495def test_load_kasvs_ecdh_vectors_empty_vector_data():CODE
LOWtests/test_utils.py3499def test_load_kasvs_ecdh_vectors():CODE
LOWtests/test_utils.py3928def test_load_kasvs_ecdh_kdf_vectors():CODE
LOWtests/test_utils.py4236def test_load_nist_ccm_vectors_dvpt():CODE
LOWtests/test_utils.py4332def test_load_nist_ccm_vectors_vadt():CODE
LOWtests/test_utils.py4472 def test_inspect_deprecated_module(self):CODE
LOWtests/test_warnings.py54 def test_deleting_deprecated_members(self, monkeypatch):CODE
LOWtests/test_doubles.py25 def test_public_bytes_raw_not_implemented(self):CODE
LOWtests/test_doubles.py30 def test_verify_not_implemented(self):CODE
LOWtests/test_doubles.py40 def test_copy_not_implemented(self):CODE
LOWtests/test_doubles.py45 def test_deepcopy_not_implemented(self):CODE
LOWtests/test_fernet.py115 def test_timestamp_ignored_no_ttl(self, monkeypatch):CODE
LOWtests/test_fernet.py122 def test_ttl_required_in_decrypt_at_time(self):CODE
LOWtests/test_fernet.py196 def test_non_iterable_argument(self):CODE
LOWtests/test_fernet.py239 def test_rotate_preserves_timestamp(self):CODE
LOWtests/test_fernet.py257 def test_rotate_decrypt_no_shared_keys(self):CODE
LOWtests/test_fernet.py267 def test_extract_timestamp_first_fernet_valid_token(self):CODE
LOWtests/test_fernet.py274 def test_extract_timestamp_second_fernet_valid_token(self):CODE
LOWtests/test_fernet.py282 def test_extract_timestamp_invalid_token(self):CODE
LOWtests/utils.py33def raises_unsupported_algorithm(reason):CODE
LOWtests/utils.py343def load_fips_dsa_key_pair_vectors(CODE
LOWtests/utils.py384def load_fips_dsa_sig_vectors(vector_data: typing.Iterable[str]) -> list[dict]:CODE
LOWtests/utils.py462def load_fips_ecdsa_key_pair_vectors(CODE
LOWtests/utils.py503def load_fips_ecdsa_signing_vectors(CODE
LOWtests/bench/test_x509.py17def test_object_identifier_constructor(benchmark):CODE
LOWtests/bench/test_x509.py30def test_load_der_certificate(benchmark):CODE
LOWtests/bench/test_x509.py40def test_load_pem_certificate(benchmark):CODE
LOWtests/bench/test_x509.py76def test_certificate_public_key(benchmark):CODE
LOWtests/bench/test_x509.py86def test_certificate_signature_hash_algorithm(benchmark):CODE
LOWtests/bench/test_x509.py96def test_certificate_signature_algorithm_oid(benchmark):CODE
LOWtests/bench/test_x509.py116def test_crl_serial_number_lookup_hit(benchmark):CODE
LOWtests/bench/test_x509.py128def test_crl_serial_number_lookup_miss(benchmark):CODE
LOWtests/bench/test_x509.py139def test_ocsp_request_properties(benchmark):CODE
LOWtests/bench/test_x509.py156def test_ocsp_response_properties(benchmark):CODE
LOWtests/bench/test_x509.py172def test_verify_docs_python_org(benchmark, pytestconfig):CODE
LOWtests/bench/test_ec_load.py8def test_load_ec_public_numbers(benchmark):CODE
LOWtests/bench/test_ec_load.py12def test_load_ec_private_numbers(benchmark):CODE
LOWtests/hazmat/asn1/test_api.py18 def test_repr_printable_string(self) -> None:CODE
LOWtests/hazmat/asn1/test_api.py25 def test_printable_string_as_str(self) -> None:CODE
1107 more matches not shown…
Self-Referential Comments232 hits · 694 pts
SeverityFileLineSnippetContext
MEDIUMrelease.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMnoxfile.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/test_utils.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/conftest.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/test_warnings.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/test_doubles.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/doubles.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/test_fernet.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/utils.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/test_meta.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/test_cryptography_utils.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/deprecated_module.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_x509.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_aead.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_hashes.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_fernet.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_hkdf.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_ec_load.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/bench/test_hmac.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/test_oid.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/asn1/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/asn1/test_api.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/asn1/test_serialization.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/backends/test_openssl.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/backends/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_ec.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_aead.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_hkdf_vectors.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_aes.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_xofhash.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_rsa.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_ciphers.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_hmac_vectors.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_pkcs7.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_pkcs7.py1416 # Create a signed emailSTRING
MEDIUMtests/hazmat/primitives/test_pkcs7.py1431 # Create a plain emailSTRING
MEDIUMtests/hazmat/primitives/test_aes_gcm.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_hash_vectors.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/fixtures_dsa.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_sm4.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_x448.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_block.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_kbkdf.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_ed448.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_concatkdf.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_x25519.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_cmac.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_hashes.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_hpke.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_dh.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_kbkdf_vectors.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_keywrap.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_ed25519.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_ssh.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_mlkem.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
MEDIUMtests/hazmat/primitives/test_constant_time.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
172 more matches not shown…
Over-Commented Block692 hits · 500 pts
SeverityFileLineSnippetContext
LOWci-constraints-requirements.txt1# This file was autogenerated by uv via the following command:COMMENT
LOWci-constraints-requirements.txt21 # cryptography (pyproject.toml:dev)COMMENT
LOWci-constraints-requirements.txt41 # sphinxCOMMENT
LOWci-constraints-requirements.txt61 # sphinx-rtd-themeCOMMENT
LOWci-constraints-requirements.txt81 # via sphinxCOMMENT
LOWci-constraints-requirements.txt101mypy==1.19.1 ; python_full_version < '3.10'COMMENT
LOWci-constraints-requirements.txt121 # viaCOMMENT
LOWci-constraints-requirements.txt141 # viaCOMMENT
LOWci-constraints-requirements.txt161 # pytest-benchmarkCOMMENT
LOWci-constraints-requirements.txt181requests==2.32.5 ; python_full_version < '3.10'COMMENT
LOWci-constraints-requirements.txt201 # viaCOMMENT
LOWci-constraints-requirements.txt241sphinxcontrib-spelling==8.0.2 ; python_full_version >= '3.10'COMMENT
LOWci-constraints-requirements.txt261urllib3==2.7.0 ; python_full_version >= '3.10'COMMENT
LOWtests/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/bench/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/hazmat/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/hazmat/asn1/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/hazmat/backends/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/hazmat/primitives/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/hazmat/primitives/decrepit/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/hazmat/primitives/twofactor/__init__.py1# This file is dual licensed under the terms of the Apache License, VersionCOMMENT
LOWtests/x509/verification/test_limbo.py21 VerificationError,COMMENT
LOWtests/x509/verification/test_limbo.py41 # incompatible ways. Our validator always tries (by default) to complyCOMMENT
LOWtests/x509/verification/test_limbo.py61 # We allow CAs that don't have AKIs, which is forbidden underCOMMENT
LOW…ctors/cryptography_vectors/ciphers/Blowfish/bf-ecb.txt181# CIPHERTEXT = F9AD597C49DB005ECOMMENT
LOW…ors/asymmetric/ECDSA/RFC6979/evppkey_ecdsa_rfc6979.txt1#COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt1# RSA OAEP SHA2 vectors built for https://github.com/pyca/cryptographyCOMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt21# Prime 2:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt41d94ae0832e6445ce42331cb06d531a82b1db4baad30f746dc916df24d4e3c2451fff59a6423eb0e1d02d4fe646cf699dfd818c6e97b051COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt61# Public keyCOMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt81# Coefficient:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt101# Encryption:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt121# Modulus:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt141a3dae60f0fa379c43d19aa60d09b3fbda68859a7ba4cb5ec891812cfeff512820da76e2818082e5c3a6c7507d536430e145039e87c3739b211453402COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt1615e0c62e6e1b1d7e3e52e58d48b8aa44208882fa8e8a80bfb543299bcbbe6d0a478e460c17ac567e92b0771b4394aa8729bf1ca359eac3fa9b36d65e7COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt181# Prime 1:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt201# OAEP Example 3 alg=sha256 mgf1=sha256COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt221# =============================================COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt241# Prime exponent 2:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt261# Message:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt28110001COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt3014046ca8baa3347ca27f49e0d81f9cc1d71be9ba517d4COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt32132488cb262d041d6e4dd35f987bf3ca696db1f06ac29a44693COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt341# Exponent:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt361# Encryption:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt381# Encryption:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt401# Prime exponent 1:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt421879f5f34610bfadd07b5b7c0e3002006419ef49a34b71349573236e6742a88ba0b451db0c1fa3c224ff98543bc1395ca02f96b32d10f57c5b76e7425COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt461# OAEP Example 1 alg=sha256 mgf1=sha256COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt481# OAEP Example 5 alg=sha256 mgf1=sha256COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt501# Public exponent:COMMENT
LOW…tors/asymmetric/RSA/oaep-custom/oaep-sha256-sha256.txt521# Message:COMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt1# RSA OAEP SHA2 vectors built for https://github.com/pyca/cryptographyCOMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt21# Prime 2:COMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt41d94ae0832e6445ce42331cb06d531a82b1db4baad30f746dc916df24d4e3c2451fff59a6423eb0e1d02d4fe646cf699dfd818c6e97b051COMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt61# Public keyCOMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt81# Coefficient:COMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt101# Encryption:COMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt121# Modulus:COMMENT
LOW…ectors/asymmetric/RSA/oaep-custom/oaep-sha1-sha224.txt1417b4a85ec83f1a149bbaa8568eeb917418a76cc685b0422f949a5463ef2a250af46ab07bea773c244c3a5c0d2ec6db5c7a35204997c2f6235e1a0ee45COMMENT
632 more matches not shown…
Unused Imports265 hits · 226 pts
SeverityFileLineSnippetContext
LOWnoxfile.py5CODE
LOWtests/utils.py5CODE
LOWtests/hazmat/primitives/test_ciphers.py27CODE
LOWtests/hazmat/primitives/test_ciphers.py31CODE
LOWtests/hazmat/primitives/test_hpke.py5CODE
LOWtests/x509/verification/test_limbo.py5CODE
LOWtests/wycheproof/test_mldsa.py5CODE
LOWvectors/cryptography_vectors/__init__.py8CODE
LOWdocs/conf.py61CODE
LOWsrc/cryptography/__init__.py5CODE
LOWsrc/cryptography/__init__.py7CODE
LOWsrc/cryptography/__init__.py7CODE
LOWsrc/cryptography/__init__.py7CODE
LOWsrc/cryptography/utils.py5CODE
LOWsrc/cryptography/__about__.py5CODE
LOWsrc/cryptography/exceptions.py5CODE
LOWsrc/cryptography/fernet.py5CODE
LOWsrc/cryptography/hazmat/__init__.py5CODE
LOWsrc/cryptography/hazmat/_oid.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py5CODE
LOWsrc/cryptography/hazmat/asn1/asn1.py5CODE
LOWsrc/cryptography/hazmat/decrepit/__init__.py5CODE
LOWsrc/cryptography/hazmat/decrepit/ciphers/algorithms.py5CODE
LOWsrc/cryptography/hazmat/decrepit/ciphers/__init__.py5CODE
LOWsrc/cryptography/hazmat/decrepit/ciphers/modes.py5CODE
LOWsrc/cryptography/hazmat/backends/__init__.py5CODE
LOWsrc/cryptography/hazmat/backends/openssl/backend.py5CODE
LOWsrc/cryptography/hazmat/backends/openssl/__init__.py5CODE
LOWsrc/cryptography/hazmat/backends/openssl/__init__.py7CODE
LOWsrc/cryptography/hazmat/primitives/_modes.py5CODE
LOWsrc/cryptography/hazmat/primitives/_serialization.py5CODE
LOWsrc/cryptography/hazmat/primitives/_serialization.py10CODE
LOWsrc/cryptography/hazmat/primitives/_serialization.py11CODE
LOWsrc/cryptography/hazmat/primitives/_serialization.py15CODE
LOWsrc/cryptography/hazmat/primitives/hpke.py5CODE
LOWsrc/cryptography/hazmat/primitives/cmac.py5CODE
LOWsrc/cryptography/hazmat/primitives/_asymmetric.py5CODE
LOWsrc/cryptography/hazmat/primitives/_cipheralgorithm.py5CODE
LOWsrc/cryptography/hazmat/primitives/poly1305.py5CODE
LOWsrc/cryptography/hazmat/primitives/constant_time.py5CODE
LOWsrc/cryptography/hazmat/primitives/keywrap.py5CODE
LOWsrc/cryptography/hazmat/primitives/hmac.py5CODE
LOWsrc/cryptography/hazmat/primitives/hashes.py5CODE
205 more matches not shown…
Cross-File Repetition8 hits · 40 pts
SeverityFileLineSnippetContext
HIGHsrc/cryptography/hazmat/primitives/asymmetric/x448.py0the raw bytes of the public key. equivalent to public_bytes(raw, raw).STRING
HIGH…c/cryptography/hazmat/primitives/asymmetric/ed25519.py0the raw bytes of the public key. equivalent to public_bytes(raw, raw).STRING
HIGHsrc/cryptography/hazmat/primitives/asymmetric/ed448.py0the raw bytes of the public key. equivalent to public_bytes(raw, raw).STRING
HIGHsrc/cryptography/hazmat/primitives/asymmetric/x25519.py0the raw bytes of the public key. equivalent to public_bytes(raw, raw).STRING
HIGHsrc/cryptography/hazmat/primitives/asymmetric/x448.py0the raw bytes of the private key. equivalent to private_bytes(raw, raw, noencryption()).STRING
HIGH…c/cryptography/hazmat/primitives/asymmetric/ed25519.py0the raw bytes of the private key. equivalent to private_bytes(raw, raw, noencryption()).STRING
HIGHsrc/cryptography/hazmat/primitives/asymmetric/ed448.py0the raw bytes of the private key. equivalent to private_bytes(raw, raw, noencryption()).STRING
HIGHsrc/cryptography/hazmat/primitives/asymmetric/x25519.py0the raw bytes of the private key. equivalent to private_bytes(raw, raw, noencryption()).STRING
Deep Nesting38 hits · 34 pts
SeverityFileLineSnippetContext
LOWtests/utils.py89CODE
LOWtests/utils.py117CODE
LOWtests/utils.py158CODE
LOWtests/utils.py283CODE
LOWtests/utils.py343CODE
LOWtests/utils.py384CODE
LOWtests/utils.py462CODE
LOWtests/utils.py503CODE
LOWtests/utils.py556CODE
LOWtests/utils.py611CODE
LOWtests/utils.py719CODE
LOWtests/utils.py771CODE
LOWtests/utils.py828CODE
LOWtests/hazmat/primitives/test_ec.py531CODE
LOWtests/hazmat/primitives/test_ec.py571CODE
LOWtests/hazmat/primitives/test_ec.py1518CODE
LOWtests/hazmat/primitives/test_aead.py145CODE
LOWtests/hazmat/primitives/test_aead.py331CODE
LOWtests/hazmat/primitives/test_aead.py578CODE
LOWtests/hazmat/primitives/test_hpke.py134CODE
LOWtests/hazmat/primitives/test_hpke.py199CODE
LOWtests/hazmat/primitives/test_hpke.py940CODE
LOWtests/hazmat/primitives/test_keywrap.py31CODE
LOWtests/hazmat/primitives/test_keywrap.py107CODE
LOWtests/hazmat/primitives/test_dsa.py467CODE
LOWtests/x509/test_ocsp.py1373CODE
LOWdocs/development/custom-vectors/seed/generate_seed.py17CODE
LOWdocs/development/custom-vectors/arc4/generate_arc4.py55CODE
LOWdocs/development/custom-vectors/idea/generate_idea.py17CODE
LOWdocs/development/custom-vectors/cast5/generate_cast5.py21CODE
LOW…ustom-vectors/aes-192-gcm-siv/generate_aes192gcmsiv.py44CODE
LOW.github/bin/bump_dependency.py16CODE
LOW.github/bin/merge_rust_coverage.py40CODE
LOW.github/bin/merge_rust_coverage.py59CODE
LOWsrc/cryptography/hazmat/asn1/asn1.py128CODE
LOWsrc/cryptography/hazmat/asn1/asn1.py163CODE
LOWsrc/cryptography/hazmat/primitives/serialization/ssh.py141CODE
LOWsrc/cryptography/hazmat/primitives/serialization/ssh.py981CODE
Modern Structural Boilerplate31 hits · 31 pts
SeverityFileLineSnippetContext
LOWtests/hazmat/backends/test_openssl.py28__all__ = ["rsa_key_2048"]CODE
LOWtests/hazmat/primitives/test_pkcs7.py36__all__ = ["rsa_key_2048"]CODE
LOWtests/hazmat/primitives/test_ssh.py50__all__ = ["rsa_key_2048"]CODE
LOWtests/hazmat/primitives/test_serialization.py51__all__ = ["rsa_key_2048"]CODE
LOWtests/x509/test_x509_ext.py46__all__ = ["rsa_key_2048"]CODE
LOWtests/x509/test_x509.py65__all__ = ["rsa_key_512", "rsa_key_2048"]CODE
LOWtests/x509/test_x509_crlbuilder.py39__all__ = ["rsa_key_512", "rsa_key_2048"]CODE
LOWvectors/cryptography_vectors/__init__.py10__all__ = [CODE
LOWvectors/cryptography_vectors/__about__.py5__all__ = [CODE
LOWsrc/cryptography/__init__.py9__all__ = [CODE
LOWsrc/cryptography/__about__.py7__all__ = [CODE
LOWsrc/cryptography/hazmat/asn1/__init__.py26__all__ = [CODE
LOWsrc/cryptography/hazmat/backends/openssl/__init__.py9__all__ = ["backend"]CODE
LOWsrc/cryptography/hazmat/primitives/hpke.py18__all__ = [CODE
LOWsrc/cryptography/hazmat/primitives/cmac.py9__all__ = ["CMAC"]CODE
LOWsrc/cryptography/hazmat/primitives/poly1305.py9__all__ = ["Poly1305"]CODE
LOWsrc/cryptography/hazmat/primitives/hmac.py10__all__ = ["HMAC"]CODE
LOWsrc/cryptography/hazmat/primitives/hashes.py12__all__ = [CODE
LOWsrc/cryptography/hazmat/primitives/kdf/argon2.py17__all__ = ["Argon2d", "Argon2i", "Argon2id"]CODE
LOWsrc/cryptography/hazmat/primitives/kdf/scrypt.py19__all__ = ["Scrypt"]CODE
LOWsrc/cryptography/hazmat/primitives/kdf/pbkdf2.py13__all__ = ["PBKDF2HMAC"]CODE
LOWsrc/cryptography/hazmat/primitives/kdf/hkdf.py16__all__ = ["HKDF", "HKDFExpand"]CODE
LOWsrc/cryptography/hazmat/primitives/kdf/x963kdf.py13__all__ = ["X963KDF"]CODE
LOWsrc/cryptography/hazmat/primitives/kdf/concatkdf.py16__all__ = ["ConcatKDFHMAC", "ConcatKDFHash"]CODE
LOW…yptography/hazmat/primitives/serialization/__init__.py39__all__ = [CODE
LOW…cryptography/hazmat/primitives/serialization/pkcs12.py23__all__ = [CODE
LOWsrc/cryptography/hazmat/primitives/ciphers/aead.py9__all__ = [CODE
LOWsrc/cryptography/hazmat/primitives/ciphers/__init__.py19__all__ = [CODE
LOWsrc/cryptography/x509/oid.py23__all__ = [CODE
LOWsrc/cryptography/x509/verification.py12__all__ = [CODE
LOWsrc/cryptography/x509/__init__.py179__all__ = [CODE
Fake / Example Data6 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/hazmat/primitives/test_cmac.py47fake_key = b"\x00" * 16CODE
LOWtests/hazmat/primitives/test_cmac.py122 only_if=lambda backend: backend.cipher_supported(ARC4(fake_key), None),CODE
LOWtests/x509/test_x509_ext.py1763 fake_key = DummyEd25519PublicKey(data)CODE
LOWtests/x509/test_x509_ext.py1765 _key_identifier_from_public_key(fake_key)CODE
LOWtests/x509/test_x509_ext.py1772 fake_key = DummyEd25519PublicKey(data[:-1] + b"\x00")CODE
LOWtests/x509/test_x509_ext.py1774 _key_identifier_from_public_key(fake_key)CODE
Redundant / Tautological Comments5 hits · 8 pts
SeverityFileLineSnippetContext
LOWtests/test_utils.py4473 # Check if inspection is supported by _ModuleWithDeprecations.COMMENT
LOWtests/x509/test_x509.py699 # Check if all reason flags can be found in the CRL.COMMENT
LOW.github/bin/bump_downstreams.sh57 # Check if this downstream had updates (commit message file has content)COMMENT
LOWsrc/cryptography/hazmat/asn1/asn1.py326 # Check if this is a Variant[T, Tag] typeCOMMENT
LOWsrc/cryptography/hazmat/primitives/asymmetric/rsa.py281 # Check if a^k is a non-trivial root of unity (mod n)COMMENT
Excessive Try-Catch Wrapping6 hits · 6 pts
SeverityFileLineSnippetContext
LOWtests/wycheproof/test_mlkem.py37 except Exception as e:CODE
LOWtests/wycheproof/test_mlkem.py105 except Exception as e:CODE
LOWdocs/_ext/linkcode_res.py57 except Exception:CODE
LOWdocs/_ext/linkcode_res.py67 except Exception:CODE
LOWdocs/_ext/linkcode_res.py84 except Exception:CODE
LOWdocs/_ext/linkcode_res.py91 except Exception:CODE
AI Structural Patterns3 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/hazmat/primitives/test_ssh.py404CODE
LOWsrc/cryptography/hazmat/primitives/serialization/ssh.py1223CODE
LOWsrc/cryptography/x509/base.py296CODE
AI Slop Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
LOWtests/hazmat/primitives/test_rsa.py124 # just add that to the end of the tupleCOMMENT