Skip to main content

Timing attacks

Project description

Timestrike

Python library for timing attacks

Usage

The library provides two functions: get_length to obtain the length of the key, and get_key to obtain its content. They only require the user to define the function that gives the processing time of a given string.

Examples

import socket
import time
from timestrike import get_length

def measure_time(message):
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.connect(('localhost', 1337))
        s.sendall(message.encode())
        start_time = time.time()
        s.recv(1024)
        end_time = time.time()
        response_time = end_time - start_time
        s.close()
        return response_time

k = get_key(measure_time, sample=3)
print(k)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timestrike-0.1.9.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timestrike-0.1.9-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file timestrike-0.1.9.tar.gz.

File metadata

  • Download URL: timestrike-0.1.9.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for timestrike-0.1.9.tar.gz
Algorithm Hash digest
SHA256 8803929a4251403364dc6dafe5136a60e3454c03efd37a1970381b3fb99e7472
MD5 f3c8183acdcad3c7dcca911b67c67398
BLAKE2b-256 8281e138d85eab22b4f9080677086aa79f8464053be88cdb619572c234b31041

See more details on using hashes here.

File details

Details for the file timestrike-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: timestrike-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for timestrike-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a2adf113f1331cebfcba3a10e5f83fb9f97cdc38e4791a12faf8eda8d51acc6b
MD5 2238d12c9342ee46df70965ea676e5d5
BLAKE2b-256 f106acbe09825110622216cdc98d20fdf6654f332367c0a338c71a528b78cdad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page