Lifespan Estimator

The Lifespan Estimator module is a core component of the Quantum Threat Tracker (QTT). It generates a primary output of the QTT, which is a threat timeline. Given a roadmap for particular quantum computing hardware modalities and the specifications of cryptographic protocols of interest, this module outputs an estimate of when the cryptographic protocols are predicted to be broken, along with the expected resource requirements over time.

Lifespan Estimator module.

class HardwareRoadmap(hardware_roadmap: list | None = None)[source]

Bases: object

Class for representing quantum computing hardware roadmaps.

add(timestamp: int, estimator_params: EstimatorParams | dict | list) None[source]

Add a quantum computer to the hardware roadmap.

Parameters:
  • timestamp (int) – Unix timestamp.

  • estimator_params (EstimatorParams | dict | list) – Parameters characterising the quantum computer.

Raises:

TypeError – If the estimator parameters are not given as an EstimatorParams instance or a dictionary.

as_list() list[source]

Get the hardware roadmap as a list.

Returns:

Hardware roadmap.

Return type:

list

classmethod from_file(file_path: str) Self[source]

Import a hardware roadmap from a file.

Parameters:

file_path (str) – File path.

Returns:

Hardware roadmap.

Return type:

Self

remove(timestamp: int, qc_index: int | None = None) None[source]

Remove an entry from the hardware roadmap.

Parameters:
  • timestamp (int) – Unix timestamp.

  • qc_index (int, optional) – Index for removing a specific quantum computer for a given timestamp. If unspecified, all entries with the specified timestamp will be removed.

save_roadmap(file_name: str, file_path: Path | None = None) None[source]

Save the hardware roadmap as a JSON file.

Parameters:
  • file_name (str) – File name.

  • file_path (str, optional) – File path. If unspecified, the file will be saved to the current working directory.

Raises:

AttributeError – If the hardware roadmap has not yet been generated.

class LifespanEstimator(hardware_roadmap: HardwareRoadmap)[source]

Bases: object

Class for estimating the remaining lifespan of cryptographic protocols.

estimate_threats(protocol: str, key_size: int) dict[source]

Estimate the possible threats against a given cryptographic protocol.

Parameters:
  • protocol (str) – Cryptographic protocol.

  • key_size (int) – Cryptographic key size.

Returns:

Threats against the given protocol.

Return type:

dict

generate_report(protocols: list[dict]) None[source]

Predict the threats against several cryptographic protocols.

Parameters:

protocols (list[dict]) – List of cryptographic protocols.

get_report(detail_level: int = 3, soonest_threat_only: bool = False) list[source]

Get the threat report.

Parameters:
  • detail_level (int, optional) – Level of detail in the output, by default 3.

  • soonest_threat_only (bool, optional) – Whether to only include the soonest threat for each protocol, by default False. If True, all threats other than that with the soonest timestamp will be removed from the report.

Returns:

Threat report.

Return type:

list

Raises:
  • AttributeError – If the report has not yet been generated.

  • SyntaxError – If the detail level is out of bounds.

plot_threats(protocol: str | None = None) Axes[source]

Plot the threats over time.

Parameters:

protocol (str | None, optional) – Cryptographic protocol, by default None. If specified, all threats for that protocol (instead of only the soonest) will be plotted.

Returns:

A matplotlib Axes object containing the plot.

Return type:

Axes

save_report(file_name: str, file_path: str | None = None, detail_level: int = 3) None[source]

Save the hardware roadmap as a JSON file.

Parameters:
  • file_name (str) – File name.

  • file_path (str, optional) – File path. If unspecified, the file will be saved to the current working directory.

  • detail_level (int, optional) – Level of detail in the output, by default 3.